public static void main(
String args[])
{
int [] def=new int[10];
def=null;
def[0]=5;
System.out.println(def[0]);
}
If we run this code it will provide a null pointer exception this is well explained because def is refering to null.
but the confusion is with the line " def[0]=5 " , is there any significance of this line? value 5 will be assigned to what??