更多"执行下面程序后输出的正确结果是 public class Test "的相关试题:
[单项选择]执行下面程序后输出的正确结果是
Public class Test
public static void main(String args[])
byte x=3,y=4;
long r=80L;
System.out.print(r/y);
System.out.print(”,”);
System.out.print(x/y);
A. 20.0,1
B. 20.0,1.0
C. 20,0
D. 20,1.0
[单项选择]执行下面程序后输出的正确结果是
public class Test
public static void main(String args[])
byte x=3,y=4;
long r=80L;
System.out.print(r/y);
System.out.print(",");
System.out.print(x/y);
A. 20.0,1
B. 20.0,1.0
C. 20,0
D. 20,1.0
[单项选择]执行下面程序后输出的正确结果是( )。
public class Test
public static void main(String args[])
byte x=3,y=4;
long r=80L;
System.out.print(r/y);
System.out.print(",");
System.out.print(x/y);
A. 20.0,1
B. 20.0,1.0
C. 20,0
D. 20,1.0
[单项选择]执行下面程序后输出的正确结果是( )。
public class Test
public static void main(String args[])
byte x=3,y=4;
long r=80L:
System.out.print(r/y);
System.out.print(",");
System.out.print(x/y);
A. 20.0,1
B. 20.0,1.0
C. 20,0
D. 20,1.0
[单项选择]执行下面程序后,输出的正确结果是( )。
public class Test
public static void main (String args [])
System. out. print (100%3);
System. out. print(“,”);
System. out. print(100%3.0);
A. 1,1
B. 1,1,0
C. 1.0,1
D. 1.0,1.0
[单项选择]执行下面的程序后,输出的结果是______。
public class Test
public static void main(String args[ ])
byte x=3,y=4;
long r=80L;
System.out.print(r/y);
System.out.print(",");
System.out.print(x/y);
A. 20.0,1
B. 20.0,2.0
C. 20,0
D. 20,1.0
[单项选择]下面程序执行后,输出的结果是( )。 public class Test { public static void main (String[] )args) { boolean m=true; if(m==false) System.out.println("假"); else if(m====true) System.out.println("真"); else System.out.println ("错误"); } }
A. 真
B. 假
C. 错误
D. 编译出错
[单项选择]下列代码的执行结果是 public class Test public int aMethod( ) static int i=0; i+ +; System.out.println(i); public static void main(String args[ ]) Test test = new Test( ); test.aMethod( );
A. 编译错误
B. 0
C. 1
D. 运行成功,但不输出
[单项选择]下列程序的执行结果是 ( )
public class Test
public int aMethod( )
satic int i=0;
i++;
System.out.println(i);
public static void.main(String args[])
Test test=new Test( );
test.aMethod( );
A. 编译错误
B. 0
C. 1
D. 运行成功,但不输出
[单项选择]下面代码的运行结果是
public class Test
public static void main(String args[])
for(int i 0;i<3;i++)
if(i<2)
continue;
System.out.println(i);
A. 0
B. 1
C. 2
D. 3
[单项选择]下面程序的输出结果是
public class Test
public static void main(String[] args)
int[]array=2,4,6,8,10;
int size=6;
int result=-1:
try
for(int i=0;i<size&&result==-1;i++)
if(array[i]==20)result=i;
catch(ArithmeticException e)
System.out.println("Catch---1");
catch(ArrayIndexOutOfBoundsException e)
System.out.println("Catch---2");
catch(Exception e)
System.out.println("Catch---3");
A. Catch---1
B. Catch一--2
C. Catch---3
D. 以下都不对
[单项选择]下面程序段的输出结果是
public class Test
public static void main(Stringargs[])
int x,y;
x=(int)Math.sqrt(5)/2+(int)Math.random( )*5/2;
y=(int)Math.sqrt(3)/2+(ht)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. 编译错误
[单项选择]执行下列程序后,输出结果为( )。
public class Test
public static void main (String[] args)
StringBuffer sb = new StringBuffer("北京 2008" );
System. out. println ("length =" + sb. length ( ) );
A. length = 8
B. length = 10
C. length = 6
D. length = 20