your condition is out of the loop is wrong.
your code: for (int j = 0; j <= a[1].length; j++) isnot correct
for(int j = 0; j < a[1].length; j++) iscorrect
index of array in java is counted from 0.
More information about the array by reference:
https://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html
Comments
Leave a comment