I want to use a 2D array for a gradebook method, where it has the student names, then the exam scores. In the class I have as follows.
private int numberOfStudents;
private String [] studentName;
private int examNumber;
private int [] examScores;
private int [][] gradebook;
public ExamAverage ()
{
numberOfStudents = 0;
studentName = new String[numberOfStudents];
examNumber = 0;
examScores = new int [numberOfStudents];
gradebook = new int [numberOfStudents][examScores];
Yet I get an error int[] cannot be converted to int.
See Question&Answers more detail:os