What will be the result of attempting to compile and run the following program?.
public class Main { public static void main(String[] args) { RuntimeException re = null; throw re; } }
Select the one correct answer.
main()
method does not declare that it throws RuntimeException in its declaration.(d)
The program will compile without error, but will throw a NullPointerException when run.
The throw statement can only throw Throwable objects.
A NullPointerException will be thrown if the expression of the throw statement results in a null reference.