Discussion :: Objects and Collections - Finding the output (Q.No.4)
|Ignacius said: (Mar 13, 2012)|
|Exception in thread "main" java.lang.NullPointerException
|Rajesh Kushwaha said: (Sep 22, 2014)|
|At this line : private static intx only reference variable is declared. No size of this array is declared.
And on Run Time : System.out.println(x);
We are accessing 0th position of this array index value. But no any value or size declared or initialized above so NullPointerException at runtime occur.
|Vaijeyanthi said: (Jan 25, 2017)|
|Yes, it is declared exceptionally.|
Post your comments here:
Email : (optional)
» Your comments will be displayed only after manual approval.