Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java 2d array for each

public static void main(String[] args) {
	int[][] array = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
  
  	for(int[] count : array) {
    	for(int elem : count) {
          
        	System.out.print(elem + " "); 	//output: 1 2 3 4 5 6 7 8 9 
        }
    }
}
 
PREVIOUS NEXT
Tagged: #java #array
ADD COMMENT
Topic
Name
1+9 =