There are many reasons to get a Null pointer Exception . Burn it in ur Brain : NullPointerException can occur only on OBJECTS . not primitives.the above said answer holds a good example .Example 2: &n...
I can give you example if you create string array and you not assing any value for that string object. when you want print this array the JVM give Null pointer Exception