-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,604
  • 3
  • 27
  • 41

1 Answers1

2

The value of x is null.

It gives a NullPointerException when you do:

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