java computer science array access issues
I exactly what my problem is but I don't know how to fix it. I must access the arrays/matrix then have them dislplay on the screen in a certain order. I have attach a word doc for the order need. My main issue is accessing the array I know there is an issue with the way I access the arrays and I don't know how to sort and take out the data in the array. don't worry the doc is clean and thank you for your time!
// This is the student, starting file of the TextLab07 assignment.
public class TextLab07st
public static void main(String args)
Matrix m1 = new Matrix(3,4,1234);
Matrix m2 = new Matrix(3,4,1234);
Matrix m3 = new Matrix(3,4,4321);
System.out.println("m1 is equal to m2\n");
System.out.println("m1 is not equals to m2\n");
System.out.println("m1 is equal to m3\n");
System.out.println("m1 is not equals to m3\n");
private int rows;
private int cols;
private int mat;
public Matrix(int rows, int cols, int seed)
this.rows = rows;
this.cols = cols;
mat = new int[rows][cols];
Random rnd = new Random(seed);
for (int r = 0; r < rows; r ++)
for (int c = 0; c < cols; c++)
int randomInt = rnd.nextInt(90) + 10;
mat[r][c] = randomInt;
public String ToString()
String OrenthalJames213 = "";
for (int r = 0; r < rows; r++);
for (int qw = 0; qw < cols; qw++)
OrenthalJames213 = mat[r][qw];
Re: java computer science array access issues
Please edit your post and wrap your code with code tags:
<YOUR CODE HERE>
to get highlighting and preserve formatting.
Please copy and paste here the text of any doc needed. No links.
Please explain what the issue is.
My main issue is accessing the array