Multiple choice

What is the output of the above program?

public class A

{

             static int a;

           public static void main(String args[])

             {

             System.out.println(a);

             }

}

 

  1. Compilation error

  2. 0

  3. Runtime error

  4. NullpointerException

  5. None of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

 Instance variables will be initialized by compiler.