-1

Or what is its value exactly?

This pertains to a question about this code:

private static int[] x;

   public static void main(String[] args)
   {
      System.out.print(x[0]);
   }

Which does not compile (obviously).

Cody Smith
  • 2,732
  • 3
  • 31
  • 43

1 Answers1

2

The value of x is null.

It gives a NullPointerException when you do:

System.out.print(x[0]);
thegauravmahawar
  • 2,802
  • 3
  • 14
  • 23