-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathMain.java
More file actions
33 lines (23 loc) · 889 Bytes
/
Main.java
File metadata and controls
33 lines (23 loc) · 889 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
package students.amanidrummond;
import java.util.ArrayList;
import java.util.List;
public class Main {
public static void main(String[] args) {
Student student1 = new Student(1, "Jordan", "Smith",
"jordan.smith@example.com", 2, 3.8);
Student student2 = new Student(2, "Marcus", "Brown",
"marcus.brown@example.com", 1,2.9);
Instructor instructor1 = new Instructor(3, "John", "Rivera",
"john.rivera@example.com", "Computer Science");
instructor1.addStudent(student1);
instructor1.addStudent(student2);
List<Person> people = new ArrayList<>();
people.add(student1);
people.add(student2);
people.add(instructor1);
for (Person person : people) {
System.out.println(person.getSummary());
}
instructor1.printRoster();
}
}