Given a method that must ensure that its parameter is not null: 11. public void someMethod(Object value) { 12. // check for null value ... 20. System.out.println(value.getClass()); 21. } What inserted at line 12, is the appropriate way to handle a null value?()
第1题:
A.True
B.Not true
C.An exception is thrown at runtime.
D.Compilation fails because of an error at line 12.
E.Compilation fails because of an error at line 19.
第2题:
A. java.lang.RuntimeException: Problem
B. run.java.lang.RuntimeException: Problem
C. End of method.java.lang.RuntimeException: Problem
D. End of method.run.java.lang.RuntimeException: Problem
E. run.java.lang.RuntimeException: Problem End of method.
第3题:
A.5
B.10
C.12
D.17
E.24
第4题:
1. public class Test { 2. int x= 12; 3. public void method(int x) { 4. x+=x; 5. System.out.println(x); 6. } 7. } Given: 34. Test t = new Test(); 35. t.method(5); What is the output from line 5 of the Test class?()
第5题:
Which two statements are true about the hashCode method?()
第6题:
A.Line 33 must be called within a try block.
B.The exception thrown by method1 in class A is not required to be caught.
C.The method declared on line 31 must be declared to throw a RuntimeException.
D.On line 5 of class A, the call to method2 of class B does not need to be placed in a try/catch block.
第7题:
T/T is a quicker method of payment than a banker’s demand draft.
A对
B错
第8题:
A.00
B.0001
C.000120
D.00012021
E.Compilation fails.
F.An exception is thrown at runtime.
第9题:
Given: 6.
第10题:
Given the ActionEvent, which method allows you to identify the affected component?()