/****** * @author G Towell * File: Student.java * Created: Sep 6, 2019 * Modified: Sep 6, 2019 * Desc: class to implement Student *******/ public class Student { /** * The student's legal name **/ private String name; /** * The student ID. NOT revisable **/ private final int id; /** * Construct a student * @param name the name * @param id the id (can never be changed) **/ public Student(String name, int id) { this.name = name; this.id = id; } /** * @return the name of the student **/ public String getName() {return name;} /** * @return the id of the student **/ public int getId() {return id;} @Override // directive to compiler that your are overriding an inherited method. // If there is nothing to overide, compile fails // If you change something that others override, it is easier to find public String toString() { return name+" "+id; } }