I have the following schema in UML:
Lecturer----implements-----Teaches (interface)
|
Assistant-----implements-----|
so I want my interface to have a list of Courses that the teacher could lecture and that the assistant could do it also. So far I have the following code:
public interface Teaches{
public String[] coursesList=new String[3];
}
//class Teacher enters couses into the coursesList like this:
public class Teacher{
//////
private int i;
//currently omitting some arguments in the constructor
public Teacher(){
i=1;
}
addCourse(String course){
coursesList[i]=course;
i++;
}
the same procedure is done by the Assistant class, but when I print the data I have noticed that only lists me the courses from the teacher and not from assistant. Is there any way that situation does not happen?
Thanks