CodeHS Java9.2.6 Students Part 2 Student.java code example
Example: CodeHS Java9.2.6 Students Part 2 Student.java
public class Student
{
private String name;
private int classYear;
// Constructor goes here
public Student(String name, int year){
this.name = name;
this.classYear = year;
}
public String getName(){
return name;
}
public int getClassYear(){
return classYear;
}
public String toString(){
return name + ", class of " + classYear;
}
}