更多"以下代码的运行结果是______。
public class "的相关试题:
[单项选择]下列程序的输出结果是______。 public class exl5 { public static void main(String[] args) { int a=2, b=8,c=12; a1: while( a<--c } { a2: do { a+=c; if (c==b++) { continue a1; } }while (true); } System.out.print (a); } }
A. 52
B. 46
C. 38
D. 0
[单项选择]下面代码的运行结果是
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 exl4
{
public static void main(String args [])
{
int i = O;
while(i < 10)
{
i++;
if(i == 5)
continue;
}
System.out.println(i);
}
}
[单项选择]下面代码的运行结果是( )。
public class ConcatTest
public static void main (String[ ] args)
String str1 = "abc";
String str2 = "ABC";
String str3 = str1. coneat(str2);
System. out. println(str3);
A. abc
B. ABC
C. abcABC
D. ABCabc
[单项选择]下列代码的执行结果是 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 static void main(String args[])
int a=4,b=6,c=8;
String s="abc";
System.out.println(a+b+s+c);
System.out.println( );
A. ababcc
B. 464688
C. 46abc8
D. 10abc8
[单项选择]下列代码的执行结果是( )。
public class Test
public static void main(String[]args)
int[]x=0,1,2,3;
forint i=0;i<3;1+=2)
try
system.out.println(x[i+2]/x[i]+x[i+1]);
catch(ArithmeticException e)
System.out.println("error1");
catch(Exception e)
System.out.println("error2");
A. error1
B. error2
C. error1
D. 2
[填空题]
下列代码的执行结果是()。
public class Expression
public static void main(String[] args)
int v1=10,v2=99,v3=0;
System.out.println((v1<0)&&(v2/v3)==3);
[单项选择]下列代码的执行结果是( )。
public class Test
public static void main(String args[ ])
int a =4,b=6,c=8;
String s ="abc";
System.out.println(a+b+s+c);
System.out.println( );
A. ababcc
B. 464688
C. 46abc8
D. 10abc8
[填空题]以下程序运行后输出的结果是______。
public class exl7
{
public static void main(String args [])
{
int a = 0;
for(int j = 1; j <= 20; j++)
if(j%5 != 0)
a = a + j;
System.out.println (a);
[单项选择]下列程序的运行结果是( )。
public class Sun
public static void main(String args[ ])
int number,digits;
number=53;
if(number<10)
digits=1;
else
if(number<100)
digits=2;
else
digits=3;
System.out.println(digits);
A. 1
B. 2
C. 3
D. 0
[单项选择]下列代码的执行结果是( )。
public class Test
public static void main String args[])
String s1=new String("welcome");
String s2=new String("welcome");
System.out.println(s1==s2);
System.out.println(s1.equals(s2));
A. false,false
B. false,true
C. true,true
D. true,false
[单项选择]下列代码的执行结果是( )。
public class Test
public int aMethod( )
static int i=0;
1++;
System.out.println(i):
public static void main (String args[])
Trest test=new Test ( );
test aMethod( ):
A. 编译错误
B. 0
C. 1
D. 运行成功,但不输出