单项选择题X 纠错
A. The code compiles and “s=” is printed.
B. The code compiles and “s=null” is printed.
C. The code does not compile because string s is not initialized.
D. The code does not compile because string s cannot be referenced.
E. The code compiles, but a NullPointerException is thrown when toString is called.
你可能喜欢
多项选择题
A. Final int k = 4;
B. Public int k = 4;
C. Static int k = 4;
D. Private int k = 4;
E. Abstract int k = 4;
F. Volatile int k = 4;
单项选择题
A. Foo has the value “”
B. Foo has the value null
C. An exception is thrown
D. The code will not compile
单项选择题
A. Java Test 2222
B. Java Test 1 2 3 4
C. Java Test 4 2 4 2
D. Java Test 4 3 2 1
单项选择题
A. Compilation will succeed.
B. Compilation will fail at line 5.
C. Compilation will fail at line 6.
D. Compilation will fail at line 14.
E. Compilation will fail at line 17.
单项选择题
A. 4, 4
B. 4, 5
C. 5, 4
D. 5, 5
E. The code will not compile.
多项选择题
A. The default constructor initializes method variables.
B. The compiler always creates a default constructor for every class.
C. The default constructor invokes the no-parameter constructor of the superclass.
D. The default constructor initializes the instance variables declared in the class.
E. When a class has only constructors with parameters, the compiler does not create a default constructor.
单项选择题
A. It prints f2[0] = 0.0
B. It prints f2[0] = NaN
C. An error at line 5 causes compile to fail.
D. An error at line 6 causes compile to fail.
E. An error at line 6 causes an exception at runtime.
单项选择题
A. Compilation will fail.
B. Compilation succeeds and no exceptions are thrown.
C. Compilation succeeds but an exception is thrown at line 5 in ClassTest.java.
D. Compilation succeeds but an exception is thrown at line 6 in ClassTest.java.
多项选择题
A.AnAdapter1 aa=new AnAdapter1(){}
B.AnAdapter0 aa=new AnAdapter0(){}
C.AnAdapter0 aa=new AnAdapter0(5){}
D.AnAdapter1 aa=new AnAdapter1(5){}
E.AnInterface a1=new AnInterface(5){}
单项选择题
A. Compilation succeeds and 1 is printed.
B. Compilation succeeds and 2 is printed.
C. An error at line 8 causes compilation to fail.
D. An error at line 14 causes compilation to fail.
E. Compilation succeeds but an exception is thrown at line 14.