Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Traversing a double dimensional array

public class DDArray_Traverse{

  	public static void main(){
//suppose the array is stored in variable arr of size m X n
		m = 10;
        n = 10;
		int[][] arr = new int[m][n];

		for(int row = 0; row < arr.length; row++){
			for(int col = 0; col < arr[0].length; col++){
    			//do whatever operation you like
       			int element = arr[row][col]; //to access each element in the array
    		}
		}
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: spring get bean with generic type 
Java :: how to compare 3 numbers in java 
Java :: border bottom android xml 
Java :: java par o impar 
Java :: system.out.write in java example 
Java :: java compare two lists ignore case 
Java :: get block player is looking at bukkit 
Java :: java real random 
Java :: character.isalphanumeric java 
Java :: java random Double between 
Java :: how to check if a char is equal to int java 
Java :: javadoc links to url 
Java :: JAVA_HOME is not defined correctly. 
Java :: react native android gif 
Java :: first java program 
Java :: compare date with current date in android 
Java :: get value textfield java 
Java :: java load .json file 
Java :: java int to int array 
Java :: change java version maven 
Java :: array to list 
Java :: android videoview setup 
Java :: java output 
Java :: java foreach list 
Java :: how to read a string after an integer in java 
Java :: Read from text file android studio 
Java :: shell sort java 
Java :: select word from array 
Java :: how to do stuff with a scoreboard minecraft 
Java :: How to perform breadth first search through a binary tree, in Java? 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =