I have an object of a student; one of the features is an array of students. I want to know how to make a function that changes the array...
class Student {
private int [][]grades = new int 10;
private String name;
public Student(int[][] grades, String name) {
this.grades = grades;
this.name = name;
}
public setGrades(?)
??
The problem I have is where there are question marks.
Method setGrades
could look like this:
public void setGrades(int [][]grades) {
this.grades = grades;
}
And you don't have to initialize table grades
because initialization is in the constructor. Constructor starts his job when an object is creating before any operations.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments