Which exception or error should be thrown by the virtual machine?

Given:
10. public class ClassA {
11. public void count(int i) {
12. count(++i);
13. }
14. }
And:
20. ClassA a = new ClassA();
21. a.count(3);
Which exception or error should be thrown by the virtual machine?

Given:
10. public class ClassA {
11. public void count(int i) {
12. count(++i);
13. }
14. }
And:
20. ClassA a = new ClassA();
21. a.count(3);
Which exception or error should be thrown by the virtual machine?

A.
StackOverflowError

B.
NullPointerException

C.
ExceptionInInitializerError

D.
IllegalArgumentException

E.
NumberFormatException



Leave a Reply 0

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