Code Download --> lab1.zip
|
In-Class Exercise
Modify UseList.java so that it now uses a different implementation of the java.util.List interface instead of java.util.ArrayList. Did you have to change anything else in the program? |
|
In-Class Exercise
Working as partners, explain the benefit of using the java.util.Iterator interface. It is probably easiest to explain using the UseList.java program - consider using a data structure different to the List but that provides an iteration. Using an iteration, illustrate how the iterator decouples the relationship between the list implementation (or any other data structure) and the method for traversing through the list. |
| Quick In-Class Exercise Draw the UML diagram first showing the relationship between java.util.Stack and java.util.Vector. Next, draw the relationship between CompositionStack and java.util.Vector. |
|
Slightly-Longer In-Class Exercise
Complete the UML exercise of page 25 of your text.
|