Engineering Full Stack Apps with Java and JavaScript
What will be the result of attempting to compile and run the following program?
public class TestClass{ public static void main(String args[]){ Exception e = null; throw e; } }
Select 1 option
A. The code will fail to compile.
B. The program will fail to compile, since it cannot throw a null.
C. The program will compile without error and will throw an Exception when run.
D. The program will compile without error and will throw
java.lang.NullPointerException when run
E. The program will compile without error and will run and terminate without any output.