Which two statements are true if a NullPointerException is thrown on line 3 of class C?

Refer to the Exhibit. Given:

25. try {
26. A a = new A();
27. a.method1();
28. } catch (Exception e) {
29. System.out.print(“an error occurred”);
30. }

Which two statements are true if a NullPointerException is thrown on line 3 of class C? (Choose
two.)

Refer to the Exhibit. Given:

25. try {
26. A a = new A();
27. a.method1();
28. } catch (Exception e) {
29. System.out.print(“an error occurred”);
30. }

Which two statements are true if a NullPointerException is thrown on line 3 of class C? (Choose
two.)

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.



Leave a Reply 0

Your email address will not be published. Required fields are marked *