-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathMain.java
More file actions
37 lines (24 loc) · 874 Bytes
/
Main.java
File metadata and controls
37 lines (24 loc) · 874 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
37
package masonbrown;
import java.util.ArrayList;
public class Main {
public static void main(String[] args) {
ArrayList<Person> people = new ArrayList<>();
Student s1 = new Student(1, "Jordan", "Smith",
"jordan@email.com", 2, 3.8);
Student s2 = new Student(2, "Marcus", "Brown",
"marcus@email.com", 1, 2.9);
Instructor instructor = new Instructor(3, "Dr.", "Rivera",
"rivera@email.com", "Computer Science");
instructor.addStudent(s1);
instructor.addStudent(s2);
people.add(s1);
people.add(s2);
people.add(instructor);
// POLYMORPHISM
for (Person p : people) {
System.out.println(p.getSummary());
}
System.out.println();
instructor.printRoster();
}
}