class Output { public static void main(String [] args) { int i = 4; System.out.print("3" + i + " "); System.out.print(i + 4 + "6"); System.out.println(i + "7"); } } 结果为()
第1题:
下列程序输出结果为( )。public class test { public static void main(String args[]) { int a=0; outer: for(int i=0;i<2;i++) { for(int j=0;j<2;j++) { if(j>i) { continue outer; } a++; } } System.out.println(a); }}
A.0
B.2
C.3
D.4
第2题:
下列程序输出结果为( )。 public class test { public static void main (String args[]) { int a=0; outer:for(int i=0;i<2;i + +) { for(int j=0;j<2;j+ +) { if(j>i) { continue outer; } a+ +; } } System.out.println(a); } }
A.0
B.2
C.3
D.4
第3题:
A.编译错误
B.200
C.100200
D.100
第4题:
public class TestApp{ public static void main(String[] args){ try{ int i = 0; int j = 1 / i; System.out.println(“1”); } catch(Exception e){ System.out.print(“3”); } finally{ System.out.print(“4”); } } } 上述程序运行后的输出是哪项?()
第5题:
class TestApp{ public static void main (String[ ] args){ for(int i=0;i<10;i++){ if(i==3) break; System.out.print (i); } } } 程序运行后的输出是哪项?()
第6题:
class Output{ public static void main(String[] args){ int i=4; System.out.print("3"+i+" "); System.out.print(i+4+"6"); System.out.println(i+"7"); } } 结果为:()
第7题:
public class Test { public static void main(String args[]) { class Foo { public int i = 3; } Object o = (Object)new Foo(); Foo foo = (Foo)o; System.out.println(“i = “ + foo.i); } } What is the result?()
第8题:
现有: class Output { public static void main (String[] args) { int i=5: System.out.print( "4"+i+""); System.out.print (i+5+"7"); System.out.println (i+"8"); } } 结果为:()
第9题:
7 8611
7 44647
34 8611
34 8647
34 44611
34 44647
第10题:
123456
123455
123450
编译错误
第11题:
7 8611
7 44647
34 8611
34 8647
第12题:
5555
555
555
55
第13题:
以下程序的输出结果为( )。 public class Main { public static void main(String[] args) { int i=0, j=0, a=6; if((++i>0)||(++j>0)) a++; System.out.println( "i=" +i+", j ="+j+", a="+A; } }
A.i=0, j=0, a=6
B.i=1, j=1, a=7
C.i=1, j=0, a=7
D.i=0, j=1, a=7
第14题:
以下程序的运行结果为?
class ValHold{
public int i = 10;
}
public class ObParm{
public static void main(String argv[]){
ObParm o = new ObParm();
o.amethod();
}
public void amethod(){
int i = 99;
ValHold v = new ValHold();
v.i=30;
another(v,i);
System.out.print( v.i );
}
public void another(ValHold v, int i){
i=0;
v.i = 20;
ValHold vh = new ValHold();
v = vh;
System.out.print(v.i);
System.out.print(i);
}
}
A.10030
B. 20030
C. 209930
D. 10020
第15题:
程序: class TestApp{ public static void main(String[] args){ for(int i=0;i<5;i++) System.out.print(i+1); System.out.println(i); } } 上述程序运行后的结果是哪项?()
第16题:
public class Alpha{ private static Character() ids; public static void main( String[] args){ ids = new Character[args.length]; for (int i=0; i
第17题:
程序: class TestApp{ int i public static void main(String[] args){ for(int i=0;i<5;i++) System.out.print(i+1); System.out.println(i); (i没有定义) } } 上述程序运行后的结果是哪项?()
第18题:
程序: class TestApp{ public static void main(String[] args){ for(int i=0;i<10;i++){ if(i==3) break; System.out.print(i); } } } 程序运行后的输出是哪项?()
第19题:
1) class Person { 2) public void printValue(int i, int j) {/*…*/ } 3) public void printValue(int i){/*...*/ } 4) } 5) public class Teacher extends Person { 6) public void printValue() {/*...*/ } 7) public void printValue(int i) {/*...*/} 8) public static void main(String args[]){ 9) Person t = new Teacher(); 10) t.printValue(10); 11) } 12) } Which method will the statement on line 10 call? ()
第20题:
4
34
43
14
第21题:
Compilation fails.
The code runs with no output.
An exception is thrown at runtime.
The code runs, outputing a concatenated list of the arguments passed to the program.
第22题:
123456
123455
123450
编译错误
第23题:
99722
955758
4510758
459722