Question: how to store an integer in an array of strings in java. I'm working with a 2-D array and I'm trying to input integers in

how to store an integer in an array of strings in java. I'm working with a 2-D array and I'm trying to input integers in one column of the array. I tried

String[][] report = new String[8][5];

report[0][0] = "Quiz ";

report[0][1] = " High";

report[0][2] = "\t";

report[0][3] = "Low ";

report[0][4] = " Average";

for(int i = 1;i<2;i++) {

for(int j =0;j<5;j++) {

report[i][j] = "=======";

}

}

int num = 1;

for(int i =0;i<1;i++) {

for(int j =2;j<8;j++) {

report[j][i] = num.toString();

num++;

}

}

and I am getting...

(X) Cannot invoke toString() on the primitive type int

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!