1public class StudentAthlete extends Student
2{
3 private String sport;
4 private boolean eligible;
5
6 public StudentAthlete(String name, int classYear, String sport, boolean eligible){
7 super(name, classYear);
8 this.sport = sport;
9 this.eligible = eligible;
10 }
11
12
13 public String getSport(){
14 return sport;
15 }
16
17 public boolean isEligible(){
18 return eligible;
19 }
20
21 @Override
22 public String toString(){
23 return super.getName() + ", class of " + super.getClassYear() +
24 ", plays " + sport;
25 }
26}
27