单项选择题

下面程序的输出结果为( )。
public class Test
public static void main (String args[])
String X="ABCD";
String Y="EFG";
X=X.substring (X.length()-Y.length());
System.out.println(X);

A) ABC
B) BCD
C) EFG
D) ABCDEFG
<上一题 目录 下一题>
热门 试题

单项选择题
下面程序段的输出结果是 public class Test public static void main(String args[]) int x,y; x=(int)Math.sqrt(5) 2+(int)Math.random()*5 2; y=(int)Math.sqrt(3) 2+(iht)Math.random()*3 2; if(x>y) System.out.println( x>y ); else if (x==y) System.out.println( x=y ); else System.out.println( x<y );
A) x>y
B) x=y
C) x<y
D) 编译错误
单项选择题
下面的语句片段中,变量result结果为( )。 public class Test public static void main (String args[ ]) int sum=0; int r=2; iht result=(sum==1sum:r); System. out. println (result);
A) 1

B) 2

C) 10
D) 0
相关试题
  • 在编执行java程序的过程中需要用到一些工具...
  • 多线程是Java程序的______机制,它能...
  • 请将程序补充完整。 importjava.awt.*...
  • 如果有一个类MyFrame是Frame的子类,但它不...
  • ______ 是字符的序列,也是组织字符...