for(int j=0; i<array[i].length; j++)

should be:


for(int j=0; j<array[i].length; j++)

You accidentally put an i instead of a j in your condition. Fairly simple and understandable mistake.