多选题Click the Exhibit button. Given: Which two statements are true if a NullPointerException is thrown on line 3 of class C? ()AThe application will crash.BThe code on line 29 will be executed.CThe code on line 5 of class A will execute.DThe code on line

题目
多选题
Click the Exhibit button. Given: Which two statements are true if a NullPointerException is thrown on line 3 of class C? ()
A

The application will crash.

B

The code on line 29 will be executed.

C

The code on line 5 of class A will execute.

D

The code on line 5 of class B will execute.

E

The exception will be propagated back to line 27.

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

Given:Which code, inserted at line 15, creates an instance of the Point class defined in Line?()

A.Point p = new Point();

B.Line.Point p = new Line.Point();

C.The Point class cannot be instatiated at line 15.

D.Line l = new Line() ; l.Point p = new l.Point();


参考答案:B

第2题:

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 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.


参考答案:B

第3题:

Click the Exhibit button. Which statement is true about the classes and interfaces in the exhibit?()

A.Compilation will succeed for all classes and interfaces.

B.Compilation of class C will fail because of an error in line 2.

C.Compilation of class C will fail because of an error in line 6.

D.Compilation of class AImpl will fail because of an error in line 2


参考答案:C

第4题:

You are working on a debug build of an application.You need to find the line of code that caused an exception to be thrown. Which property of the Exception class should you use to achieve this goal?()

  • A、Data
  • B、Message
  • C、Stack Trace
  • D、Source

正确答案:C

第5题:

Click the Exhibit button. Given:Which two statements are true if a NullPointerException is thrown on line 3 of class C? ()

A.The application will crash.

B.The code on line 29 will be executed.

C.The code on line 5 of class A will execute.

D.The code on line 5 of class B will execute.

E.The exception will be propagated back to line 27.


参考答案:B, E

第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.


参考答案:B, C, E

第7题:

Click the Exhibit button.Given:What is the result?()

A.Line 26 prints "a" to System.out.

B.Line 26 prints "b" to System.out.

C.An exception is thrown at line 26 at runtime.

D.Compilation of class A will fail due to an error in line 6.


参考答案:A

第8题:

Given:Which three methods, inserted individually at line 14, will correctly complete class Two?()

A.int foo() { /* more code here */ }

B.void foo() { /* more code here */ }

C.public void foo() { /* more code here */ }

D.private void foo() { /* more code here */ }

E.protected void foo() { /* more code here */ }


参考答案:B, C, E

第9题:

1.class TestSuper { 22.TestSuper(int i) { } 3. } 4.class TestSub extends TestSuper{ } 5.class TestAll { 6.public static void main (String [] args) { 7.new TestSub(); 8.} 9.} Which is true?()  

  • A、 Compilation fails.
  • B、 The code runs without exception.
  • C、 An exception is thrown at line 7.
  • D、 An exception is thrown at line 2.

正确答案:A

第10题:

10. class Line {  11. public static class Point { }  12. }  13.  14. class Triangle {  15. // insert code here  16. }  Which code, inserted at line 15, creates an instance of the Point class defined in Line?() 

  • A、 Point p = new Point();
  • B、 Line.Point p = new Line.Point();
  • C、 The Point class cannot be instatiated at line 15.
  • D、 Line 1 = new Line() ; 1.Point p = new 1.Point();

正确答案:B

更多相关问题