Collection
Map
Iterable
List
Queue
Set
HashMap
HashSet
ArrayList
LinkedList
...
has
| "Firas" |
| "Felix" |
| "Taryn" |
Map<String, Instructor>Map<K, V>values: instructor objects
keys: names
Map<String, Instructor> instructors;
instructors = new HashMap<String, Instructor>();
instructors.put("Firas", new Instructor());
instructors.put("Felix", new Instructor());
instructors.put("Taryn", new Instructor());Instructor firas = instructors.get("Firas");
Instructor felix = instructors.get("Felix");
Instructor taryn = instructors.get("Taryn");HashSet
ArrayList
LinkedList
HashMap
public class Section {
private Collection<Topic> topics;
public Section(Collection<Topic> topics) {
this.topics = topics;
}
}public class Topic {
private Text text;
private Video video;
// REQUIRIES text and video to be non-null
public Topic(Text text, Video video) {
this.text = text;
this.video = video;
}
}