Answers for "CodeHS Java9.2.6 Students Part 2 Student.java"

0

CodeHS Java9.2.6 Students Part 2 Student.java

public class Student
{
    private String name;
    private int classYear;
   
   // Constructor goes here
   public Student(String name, int year){
       this.name = name;
       this.classYear = year;
   }
   
    public String getName(){
       return name;
    }
   
    public int getClassYear(){
       return classYear;
    }
   
    public String toString(){
        return name + ", class of " + classYear;
    }
}
Posted by: Guest on April-20-2021

Code answers related to "CodeHS Java9.2.6 Students Part 2 Student.java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language