codehs java 9 2 6 students part 3 studentathlete java

Solutions on MaxInterview for codehs java 9 2 6 students part 3 studentathlete java by the best coders in the world

showing results for - "codehs java 9 2 6 students part 3 studentathlete java"
Alonso
26 Jan 2019
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