In the class of Professor should be the probability of a roll call of several groups from other classes. I want to ask how this can be done correctly? I posted the code of two classes, although there are three of them. Hope this is enough.
public class Professor extends Group { Professor(Students[] studentsList) { super(studentsList); } @Override public Group process() { System.out.println("Проверка присутствия студентов:"); for (Students st : getStudentsInGroup()) { switch (st.getCall()) { case " ": System.out.println("Студент " + st.getStudentName() + " - отсутствует"); break; case "V": System.out.println("Студент " + st.getStudentName() + " - присустствует"); break; } } return null; } } public class Students{ private String StudentName; private String CandidatName; private String Call; public String getCall() { return Call; } public String getStudentName() { return StudentName; } public String getCandidatName() { return CandidatName; } Students(String studentName, String candidatName, String call) { this.StudentName = studentName; this.CandidatName = candidatName; this.Call = call; } static Students[] students = { new Students("Ануфриев Владимир", "Бевський Максим", "V"), new Students("Бевский Максим", "Ануфриев Владимир", "V"), new Students("Войтович Степан", "Бевский Максим", " "), new Students("Годун Александр", "Ануфриев Владимир", "V"), new Students("Дмитренко Степан", "Ануфриев Владимир", "V"), new Students("Ермолаев Иван", "Ануфриев Владимир", " "), new Students("Евсиков Игорь", "Бевский Максим", " "), new Students("Жебрак Алексей", "Бевский Максим", "V"), new Students("Забой Максим", "Ануфриев Владимир", "V"), new Students("Записоцкий Дмитрий", "Ануфриев Владимир", "V") }; }