单项选择题X 纠错
A. An exception is thrown.
B. The code will not compile.
C. The program prints “null”
D. The program prints “blue”
E. The program prints “green”
你可能喜欢
单项选择题
A. An exception is thrown.
B. The program exists without printing anything.
C. An error at line 1 causes compilation to fail.
D. An error at line 6 causes the compilation to fail.
E. “Running” is printed and the program exits.
多项选择题
A. Exiting from a synchronized block.
B. Calling the wait method on an object.
C. Calling the notify method on an object.
D. Calling the notifyAll method on an object.
E. Calling the setPriority method on a thread object.
单项选择题
A. The program runs and prints “i=1, j=0”
B. The program runs and prints “i=1, j=4”
C. The program runs and prints “i=3, j=4”
D. The program runs and prints “i=3, j=0”
E. An error at line 4 causes compilation to fail.
F. An error at line 7 causes compilation to fail.
单项选择题
A. Value = 3
B. Value = 4
C. Value = 5
D. Value = 6
E. Value = 7
F. Value = 8
单项选择题
A. Throws Exception.
B. Catch (Exception e).
C. Throws RuntimeException.
D. Catch (TestException e).
E. No code is necessary.
单项选择题
A. Compilation will fail.
B. Compilation will succeed and the program will print “3”
C. Compilation will succeed but the program will throw a ClassCastException at line 6.
D. Compilation will succeed but the program will throw a ClassCastException at line 7.
多项选择题
A. Final void methoda() {}
B. Void final methoda() {}
C. Static void methoda() {}
D. Static final void methoda() {}
E. Final abstract void methoda() {}
多项选择题
A. static class InnerOne { public double methoda() {return d1;} }
B. static class InnerOne { static double methoda() {return d1;} }
C. private class InnerOne { public double methoda() {return d1;} }
D. protected class InnerOne { static double methoda() {return d1;} }
E. public abstract class InnerOne { public abstract double methoda(); }
多项选择题
A. The default constructor initializes method variables.
B. The default constructor invokes the no-parameter constructor of the superclass.
C. The default constructor initializes the instance variables declared in the class.
D. If a class lacks a no-parameter constructor,, but has other constructors, the compiler creates a default constructor.
E. The compiler creates a default constructor only when there are no other constructors for the class.
单项选择题
A. Public
B. Private
C. Protected
D. Transient
E. No access modifier is required.