hmmmm......

how about try changing your for loops:


for(int i=0;i<4;i++){
for(int j=0;i<4;j++){
a[i][j] = mad.nextInt();
}
}