Abstract Interface and Polymorphism 2
Abstract Interface and Polymorphism 2
interface Instructor {
String getOfficeHours();
String[] getTeachingCourses();
}
class MonthlyEmployee {
private String name;
private double salary;
super(name, salary);
this.officeHours = officeHours;
this.teachingCourses = teachingCourses;
}
class Student {
private String name;
private int studentId;
return studentId;
super(name, studentId);
this.researchTopic = researchTopic;
}
interface Instructor {
String getOfficeHours();
String[] getTeachingCourses();
}
class Student {
private String name;
private int studentId;
public Student(String name, int studentId) {
this.name = name;
this.studentId = studentId;
}
public ResearchAssistant(String name, int studentId, String researchTopic, String officeHours, String[]
teachingCourses) {
super(name, studentId, researchTopic);
this.officeHours = officeHours;
this.teachingCourses = teachingCourses;
}
public String getOfficeHours() {
return officeHours;
}
printTeachingDetails(faculty);
printTeachingDetails(researchAssistant);
}
}