Commit 43d74edc authored by 9731065's avatar 9731065

COMPLITTED

parent d0595d7b
Pipeline #600 failed with stages
import java.util.ArrayList;
public class GraduateStudent extends Student {
private ArrayList<Publication> publications = new ArrayList<>();
private Professor advisor ;
public GraduateStudent(String firstName , String lastName , String id , int joiningYear , Department department , Professor advisor){
super(firstName , lastName , id , joiningYear , department);
this.advisor = advisor;
}
public ArrayList<Publication> getPublications() {
return publications;
}
public void addPublication (Publication p){
this.publications.add(p);
}
}
public class Publication {
private String title;
private int year;
public Publication(String title , int year){
this.title = title;
this.year = year;
}
public int getYear() {
return year;
}
public String getTitle() {
return title;
}
}
import java.util.ArrayList;
public abstract class Student extends Person {
protected ArrayList<Course> courses = new ArrayList<>();
public Student (String firstName , String lastName , String id , int joiningYear , Department department){
super(firstName , lastName , id , joiningYear , department);
}
public ArrayList<Course> getCourses() {
return courses;
}
public void addCourse(Course c){
courses.add(c);
}
}
public class UnderGradStudent extends Student {
public UnderGradStudent (String firstName , String lastName , String id , int joiningYear , Department department){
super(firstName , lastName , id , joiningYear , department);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment