Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

fill two dimensional array row by row java

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

Scanner input = new Scanner(System.in);
for (int i = 0; i < row; i++){
	for (int j = 0; j < column; j++){
        array[i][j] = input.nextInt();
	}
}

//this way u can fill your array column by column
//Scanner input = new Scanner(System.in);
for (int i = 0; i < column; i++){
	for (int j = 0; j < row; j++){
        array[i][j] = input.nextInt();
	}
}
Comment

PREVIOUS NEXT
Code Example
Java :: java create empty arraylist 
Java :: arraylist syntax in java 
Java :: how to move a marker on google maps in android studio 
Java :: creating a 2d arraylist in java 
Java :: write an infinite loop java 
Java :: java create unmodifiable list 
Java :: java unit test an api 
Java :: android kill other app programmatically by package 
Java :: java stack methods 
Java :: android:windowLightStatusBar programmatically 
Java :: change string to char array 
Java :: java instant from timestamp string 
Java :: java check palindrome with string builder 
Java :: java read file 
Java :: send action bar message bukkit 
Java :: java write in a file without overwriting 
Java :: BST in java 
Java :: initialiser une arraylist 
Java :: iterate hashmap java 
Java :: getcolor deprecated android 
Java :: final finally finalize 
Java :: java input string with spaces 
Java :: java collection interface 
Java :: how to add a list in a list java 
Java :: Java loop throug gson JsonElement 
Java :: 2d array java 
Java :: spring boot param object 
Java :: Error: Could not find or load main class javafx.controls,javafx.fxml Caused by: java.lang.ClassNotFoundException: javafx.controls,javafx.fxml 
Java :: spring boot get request body 
Java :: what is a do while loop in java 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =