81
7
11
0
false
第1题:
What will be written to the standard output when the following program is run?() public class Q63e3 { public static void main(String args[]) { System.out.println(9 ^ 2); } }
第2题:
Public class test ( Public static void main (String args[]) ( System.out.printIn (6 ^ 3); ) ) What is the output?()
第3题:
What will be written to the standard output when the following program is run?() public class Qd803 { public static void main(String args[]) { String word = "restructure"; System.out.println(word.substring(2, 3)); } }
第4题:
What will be written to the standard output when the following program is run?() public class Q8499 { public static void main(String args[]) { double d = -2.9; int i = (int) d; i *= (int) Math.ceil(d); i *= (int) Math.abs(d); System.out.println(i); } }
第5题:
What will be written to the standard output when the following program is run?() class Base { int i; Base() { add(1); } void add(int v) { i += v; } void print() { System.out.println(i); } } class Extension extends Base { Extension() { add(2); } void add(int v) { i += v*2; } } public class Qd073 { public static void main(String args[]) { bogo(new Extension()); } static void bogo(Base b) { b.add(8); b.print(); } }
第6题:
Public class test ( Public static void stringReplace (String text) ( Text = text.replace (‘j’ , ‘i’); ) public static void bufferReplace (StringBuffer text) ( text = text.append (“C”) ) public static void main (String args[]} ( String textString = new String (“java”); StringBuffer text BufferString = new StringBuffer (“java”); stringReplace (textString); bufferReplace (textBuffer); System.out.printLn (textString + textBuffer); ) ) What is the output?()
第7题:
AAA
BBB
Compilation fails.
The code runs with no output.
第8题:
The code will fail to compile.
0 will be written to the standard output.
1 will be written to the standard output.
2 will be written to the standard output.
3 will be written to the standard output.
第9题:
12
18
8
9
27
第10题:
The program will fail to compile.
The program will not terminate normally.
The program will write 10 to the standard output.
The program will write 0 to the standard output.
The program will write 9 to the standard output.
第11题:
9
18
20
21
22
第12题:
0 0 0
0 0 1
0 1 0
1 0 0
1 0 1
第13题:
Which declarations will allow a class to be started as a standalone program?()
第14题:
What will be the result of attempting to compile and run the following code?() public class Q6b0c { public static void main(String args[]) { int i = 4; float f = 4.3; double d = 1.8; int c = 0; if (i == f) c++; if (((int) (f + d)) == ((int) f + (int) d)) c += 2; System.out.println(c); } }
第15题:
public class Test { public static void main(String[] args) { String str = NULL; System.out.println(str); } } What is the result?()
第16题:
What will be written to the standard output when the following program is run?() public class Q03e4 { public static void main(String args[]) { String space = " "; String composite = space + "hello" + space + space; composite.concat("world"); String trimmed = composite.trim(); System.out.println(trimmed.length()); } }
第17题:
What will be the result of attempting to compile and run the following program?() public class Q28fd { public static void main(String args[]) { int counter = 0; l1: for (int i=10; i<0; i--) { l2: int j = 0; while (j < 10) { if (j > i) break l2; if (i == j) { counter++; continue l1; } } counter--; } System.out.println(counter); } }
第18题:
What will be written to the standard output when the following program is run?() public class Qcb90 { int a; int b; public void f() { a = 0; b = 0; int[] c = { 0 }; g(b, c); System.out.println(a + " " + b + " " + c[0] + " "); } public void g(int b, int[] c) { a = 1; b = 1; c[0] = 1; } public static void main(String args[]) { Qcb90 obj = new Qcb90(); obj.f(); } }
第19题:
第20题:
The program will terminate with an ArrayIndexOutOfBoundsException.
The program will terminate with a NullPointerException.
4 will be written to standard output.
6 will be written to standard output.
7 will be written to standard output.
第21题:
est
es
str
st
s
第22题:
第23题:
81
7
11
0
false
第24题:
5
6
7
12
13