You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

18 lines
434 B

public class Student extends Person {
private String studentId;
private double gpa;
public Student(String name, int age, String studentId, double gpa) {
super(name, age);
this.studentId = studentId;
this.gpa = gpa;
}
@Override
public String getRole() { return "Student"; }
@Override
public String getExtraInfo() {
return "ID: " + studentId + ", GPA: " + gpa;
}
}