Given:
What is the result?()
A.The value "4" is printed at the command line.
B.Compilation fails because of an error in line 5.
C.Compilation fails because of an error in line 9.
D.A NullPointerException occurs at runtime.
E.A NumberFormatException occurs at runtime.
F.An IllegalStateException occurs at runtime.
您可能感兴趣的试卷
你可能感兴趣的试题
Given:
What is the result?()
A.Compilation fails.
B.pi is bigger than 3.
C.An exception occurs at runtime.
D.pi is bigger than 3. Have a nice day.
E.pi is not bigger than 3. Have a nice day.
Click the Exhibit button.
Given:
Which statement is true if a TestException is thrown on line 3 of class B?()
A.Line 33 must be called within a try block.
B.The exception thrown by method 1 in class A is not required to be caught.
C.The method declared on line 31 must be declared to throw a runtime exception.
D.On line 5 of class A,the call to method 2 of class B does not need to be placed in a try catch block.
Given:
If class Donkey is invoked twice, the first time without assertions enabled,and the second time with assertions enabled, what are the results?()
A.no output
B.no outputassert is on
C.assert is on
D.no outputAn AssertionError is thrown.
E.assert is onAn AssertionError is thrown.
Given:
What is the result?()
A.5,6
B.5,5
C.6,5
D.6,6
Given:
Under which three circumstances will the code on line 37 be executed?()
A.The instance gets garbage collected.
B.The code on line 33 throws an exception.
C.The code on line 35 throws an exception.
D.The code on line 31 throws an exception.
E.The code on line 33 executes successfully.
Given:
If some sort of exception is thrown at line 34, which output is possible?()
A.a
B.b
C.c
D.ac
E.abc
Given:
What is the result?()
A.test end
B.Compilation fails.
C.test runtime end
D.test exception end
E.A Throwable is thrown by main at runtime.
Given:
What is the result when the go() method is invoked?()
A.00
B.0001
C.000120
D.00012021
E.Compilation fails
F.An exception is thrown at runtime
Given:
Which code, inserted at line 16, will cause a java.lang.ClassCastException?()
A.Alpha a = x;
B.Foo f = (Delta)x;
C.Foo f = (Alpha)x;
D.Beta b = (Beta)(Alpha)x;
Given:
What is the result?()
A.2
B.3
C.12
D.23
最新试题
Given:What is the result?()
Given:What is the result?()
Given a class whose instances, when found in a collection of objects, are sorted by using the compare To method, which two statements are true?()
Given:What is the appropriate definition of the hashCode method in class Person?()
Given:Which code fragment, inserted at the end of line 12, produces the output p is 420?()
Given:Which two code fragments, inserted independently at line 13, will compile?()
Click the Exhibit button.Which graph represents the correct directory structure for a JAR file from which those classes can be used by the compiler and JVM?()
Given:What is the result?()
Given:What is the result?()
Click the Exhibit buttonWhich two statements are true if a NullPointerException is thrown on line 3 of class C?()