-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathSchool.java
More file actions
36 lines (27 loc) · 846 Bytes
/
School.java
File metadata and controls
36 lines (27 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package students.coreyscott;
import java.util.ArrayList;
import java.util.List;
public class School {
private List<Student> students;
private List<Instructor> instructors;
public School() {
students = new ArrayList<>();
instructors = new ArrayList<>();
}
public void addStudent(Student student) {
students.add(student);
}
public void addInstructor(Instructor instructor) {
instructors.add(instructor);
}
public void printDirectory() {
System.out.println("=== Students ===");
for (Student student : students) {
System.out.println(student.getSummary());
}
System.out.println("\n=== Instructors ===");
for (Instructor instructor : instructors) {
System.out.println(instructor.getSummary());
}
}
}