Topics: Inheritance, Interfaces, Collections (Queue), Iterators, Generics
Skeleton Code: PartyRunner.java
(I have put all of the code in one file this time, so you won't have ten files that are five lines each. However, this is not good practice and you should really separate your work into multiple files.)
Solution Code: PartyRunner.java
Inheritance reflects an "is a" relationship between two classes. The subclass is a more specific notion of the superclass.
Inheritance is indicated in Java by the keyword "extends."
Subclasses can override (change) the behavior of methods of the superclass.(This is polymorphism.)
An Interface is a declaration of a set of methods (and possibly some variables). When a class claims to implement an interface, it is promising to provide a certain set of functionality.
In Java, a class can only extend (inherit from) one other class, but may implement many interfaces.
"Collection" is a Java interface that includes methods like add(), remove(), size(), etc. It is implemented by a number of classes in the Java library.
Iterators provide a unified way to access elements of collections.
"Queue" is a Java interface. Classes that implement this interface promise to deliver items in a first-come, first-serve way.
Generics allow the programmer to promise what type of items are in a Collection. The syntax for a Generic is Collection<...>
Generics allow type-checking to be done at compile-time, instead of run-time.
The Lab for this week involves helping the casts of 3 popular Discovery Channel series arrive at my house for a party.
The Java Doc. Keep this under your pillow.
Inheritance and Interfaces
Linked List API,