Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started