in java create the matrix from the following code without using gui : package ma
ID: 3640358 • Letter: I
Question
in java create the matrix from the following code without using gui :package matrice;
public class Main {
public static void main(String[] args) {
int array[][]= new int[100][100];
outputArray(array);
}
public static void outputArray(int[][] array) {
int rowSize = array[0].length;
int columnSize = array[0].length;
int limit=1;
for(int i = 0; i <100; i++) {
System.out.print("[");
for(int j = 0; j <100; j++) {
System.out.print(" "+limit+ array[i][j]);
}
System.out.println(" ]");
}
System.out.println();
}
}
Explanation / Answer
The question is kinda confusing. Anyway if I understood you correctly, you want to display matix on console. Save this file as Main.java public class Main { public static void main(String[] args) { int array[][]= new int[10][10]; outputArray(array); } public static void outputArray(int[][] array) { int rowSize = array[0].length; int columnSize = array[0].length; int limit=1; for(int i = 0; iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.