Horje
zweidimensionales array ausgeben java Code Example
zweidimensionales array ausgeben java
import java.util.Arrays;//muss importiert werden

int[][] A = {{1, 2, 3}, 
             {4, 5, 6}};//Array erstellen

for(int i = 0; i < A.length; i++){
  System.out.println(Arrays.toString(A[i]));//Ausgabe der Teilmengen als String
}
//Output: [1, 2, 3]
//		  [4, 5, 6]

//Wenn ich helfen konnte würde ich mich über eine Donation freuen
zweidimensionales array ausgeben java
int[][] A = {{1, 2, 3}, 
             {4, 5, 6}};//Array erstellen

for(int i = 0; i < A.length; i++){//aüßere for-Schleife bestimmt das Teilarray
	for(int j = 0; j < A[i].length; j++){//innere for-Schleife bestimmt Element aus Teilarray
     	System.out.println(A[i][j] + " "); //Ausgabe des j'ten Element der i'ten Teilmenge
    }
  System.out.println();
}
//Output: 1 2 3
//		  4 5 6	

//Wenn ich helfen konnte würde ich mich über eine Donation freuen
zweidimensionales array erstellen java
int[][] A = new int[i][j]; //erstellt zweidimensionales Array ohne Elemente
	//i legt die Anzahl an Teilmengen fest
	//j legt die Anzahl an Elementen pro Teilmenge fest
int[][] A = {{1, 2, 3}, {4, 5, 6}}; //Array wird mit zwei Teilmengen erstellt
	//diese beinhalten jeh 3 Elemente

//Wenn ich helfen konnte würde ich mich über eine Donation freuen




Java

Related
calculate the area of two squares in java by using  a method Code Example calculate the area of two squares in java by using a method Code Example
core java mcq Code Example core java mcq Code Example
how to clear cli screen Code Example how to clear cli screen Code Example
java 8 retrieve all list from object into single list and ignore duplicates Code Example java 8 retrieve all list from object into single list and ignore duplicates Code Example
add java 8 support to pom Code Example add java 8 support to pom Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8