单项选择题

下面程序的输出结果为( )。
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
相关试题
  • 下列不是InputStream子类的是( )。
  • 下列有关线程的叙述哪个是正确的A)一旦一...
  • 算法的有穷性是指( )。
  • 以下代码可以被计算机直接执行的是( )。
  • 有以下程序: void main() int i=1...