1
12
14
123
Compilation fails.
An exception is thrown at runtime.
第1题:
public static void main(String[] args) { for (int i=0;i<= 10;i++){ if( i>6) break; } System.out.println(i); } What is the result?()
第2题:
public class Yippee { public static void main(String [] args) { for(int x = 1; x < args.length; x++) { System.out.print(args[x] +“ “); } } } and two separate command line invocations: java Yippee java Yippee 1234 What is the result?()
第3题:
A.00
B.0001
C.000120
D.00012021
E.Compilation fails.
F.An exception is thrown at runtime.
第4题:
collie
harrier
Compilation fails.
collie harrier
An exception is thrown at runtime.
第5题:
public classYippee{ public static void main(String[]args){ for(intx=1;xSystem.out.print(args[x]+""); } } } and two separate command line invocations:j avaYippee javaYippee1234 What is the result?()
第6题:
System.out.format(”Pi is approximately %d.”, Math.PI); What is the result?()
第7题:
System.out.println(Math.sqrt(-4D)); What is the result?()
第8题:
String a = “ABCD”; String b = a.toLowerCase(); b.replace(‘a’, ‘d’); b.replace(‘b’, ‘c’); System.out.println(b); What is the result? ()
第9题:
String a = null; a.concat(“abc”); a.concat(“def”); System.out.println(a); What is the result?()
第10题:
No output is produced. 123
No output is produced. 234
No output is produced. 1234
An exception is thrown at runtime. 123
An exception is thrown at runtime. 234
An exception is thrown at rijntime. 1234