Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

print two dimensional array java

//this way u can print your array row by row

for (int i = 0; i < row; i++){
	for (int j = 0; j < column; j++){
        System.out.println(array[i][j]);
	}
}

//this way u can print your array column by column

for (int i = 0; i < column; i++){
	for (int j = 0; j < row; j++){
		System.out.println(array[i][j]);
	}
}
Comment

display two dimensional array java

//this way u can print your array row by row

for (int i = 0; i < row; i++){
	for (int j = 0; j < column; j++){
        System.out.println(array[i][j]);
	}
}

//this way u can print your array column by column

for (int i = 0; i < column; i++){
	for (int j = 0; j < row; j++){
		System.out.println(array[i][j]);
	}
}
Comment

2-dimensional Array java

class MultidimensionalArray {
    public static void main(String[] args) {

        // create a 2d array
        int[][] a = {
            {1, 2, 3}, 
            {4, 5, 6, 9}, 
            {7}, 
        };
      
        // calculate the length of each row
        System.out.println("Length of row 1: " + a[0].length);
        System.out.println("Length of row 2: " + a[1].length);
        System.out.println("Length of row 3: " + a[2].length);
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: how to create a subclass in java 
Java :: using a SnackBar on androidstudio 
Java :: square star pattern in java 
Java :: java stream code to ignore null 
Java :: binary number input in int java 
Java :: date to yyMMdd conversion 
Java :: android java show hide keyboard in AndroidManifest 
Java :: euclidean algorithm java recursive 
Java :: How to initialize a 3d array in Java? 
Java :: flutter webview plugin background transparent 
Java :: javafx get button id 
Java :: Sample HashMap 
Java :: hashmap put 
Java :: . Java Program to Delete the Specified Integer from an Array 
Java :: has been compiled by a more recent version of the Java Runtime (class file version 55.0) 
Java :: java csv compare 
Java :: Java Access ConcurrentHashMap Elements 
Java :: find the third largest number in an array 
Java :: multiple representations of the same entity are being merged 
Java :: update java windows 
Java :: search 
Java :: command to create a Hashmap in Java 
Java :: java interview questions 
Java :: how to get ascii value of string letter in java 
Java :: change element in array java 
Java :: stringbuilder in java 
Java :: login.html 
Java :: interface vs abstract class java 
Java :: intent class for url and phone and others 
Java :: insert node at end of doubly linked list 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =