when i write the code:
int a;
System.out.println(a);
compiler flags an error that a might not have been initialized.
but when i write this
int [] a= new int[10];
System.out.println(java.util.Arrays.toString(a));
compiler doesnot flag any error
and gives a output
[0,0,0,0,0,0,0,0,0,0]
I want to understand from where the integers stored in the array are getting initial value 0 without any expilicit initialization.
Plz.. help me out i am a beginner in java .