What will the following code print when compiled and run?
abstract class Main{ abstract void m(); public static void main (String [] args){ System.out.println ("calculating"); Main x = null; x.m (); } }
Select 1 option
MethodNotImplementedException
Correct Option is:C
For A.
It will compile fine.
For C.
After printing, when it tries to call m()
on x, it will throw NullPointerException since x is null.