Answers for "CodeHS Java 9.2.6 Students Part 3 StudentAthlete.java"

0

CodeHS Java 9.2.6 Students Part 3 StudentAthlete.java

public class StudentAthlete extends Student
{
    private String sport;
    private boolean eligible;
    
   public StudentAthlete(String name, int classYear, String sport, boolean eligible){
       super(name, classYear);
       this.sport = sport;
       this.eligible = eligible;
   }
   
   
   public String getSport(){
       return sport;
   }
   
   public boolean isEligible(){
       return eligible;
   }
    
    @Override
    public String toString(){
        return super.getName() + ", class of " + super.getClassYear() +
            ", plays " + sport;
    }
}
Posted by: Guest on April-20-2021

Code answers related to "CodeHS Java 9.2.6 Students Part 3 StudentAthlete.java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language