Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

fill two dimensional array column by column 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 :: resize image icon to fit jlabel 
Java :: has a relationship in java 
Java :: List into string java 
Java :: PathProviderPlugin.java uses unchecked or unsafe operations. 
Java :: java string array to one string 
Java :: react The href attribute is required for an anchor to be keyboard 
Java :: for each loop java string array 
Java :: load a list from text file java 
Java :: iterate thrpugh hasmap 
Java :: spring swagger 
Java :: intent in java 
Java :: icon label java 
Java :: jbutton open jframe java 
Java :: how to read comma separated values in java 
Java :: cmd java compile 
Java :: get device token firebase 
Java :: java how to define a function 
Java :: java square root 
Java :: math.absolute java 
Java :: space seperator in string in java 
Java :: java stream loop 
Java :: code to include layout from java in android 
Java :: quicksort for arraylist 
Java :: navigation view menu color android 
Java :: java stop script 
Java :: java stringbuilder 
Java :: read stream java 
Java :: java split int 
Java :: android setTextColor not working 
Java :: JsonArray get first Object 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =