0
Array initialisation
int a[ ][ ]=new int [5][5]; for (int i=0;I<5;I++) { for(int j=0;j<I+1;j++) System.out.print(a[i][j]+" "); } System.out.println(); this code outputs 0 0 0 0 0 0... and so on.. Why so? since I didn't initialise the array values. how does it give 0? I hope I made myself clear.
2 odpowiedzi
+ 1
Default value of uninitialized variables of int, float, double is 0.
0
okay, Thanks :)