The following class will not throw a NullPointerException when compiled and run.
public class Main{ public static void main (String [] args) throws Exception{ int [] a = null; int i = a [getInt()]; } public static int getInt() throws Exception{ throw new Exception ("Some Exception"); } }
Select 1 option
Correct Option is : A
m1() is called first, which throws Exception and so 'a' is never accessed and NullPointerException is never thrown.