for(int i = 0; i< z.lenght; i++){
for(....){....
package test;
public class ForSchleife {
public static void main(String[] args) {
int [][] z = {{1,8,3},{2,7,8},{3,9,4}};
for(int[]y : z){
for(int x : y){
System.out.println(x);
}
}
}
}