Dislaimer: this is not a tutorial, but only a list of steps covered by our lectures. For each step, a commented version of the code we built during the lecture is given (i.e. download and see the comments in the code to review our discussion).
- Step 1: we built a Stack ADT using Java classes, and a corresponding client code ( souce code ).
- Step 2: we exploited parametric (typing) polymorphism to build a Generic Base-type Stack ( souce code ).
- Step 3: independently, we briefly revised Object Orientation's main features, including extension and inheritance ( souce code ).
- Step 4: overriding and dynamic binding. An example of polymorphic variables ( souce code ).
- Step 5: overloading. An example of polymorphic methods ; dynamic VS static binding; compile time type checking ( souce code ).
- Step 6: combining parametric types and object orientation (part 1) by extending parametric type classes ( souce code ).
- Step 7: combining parametric types and object orientation (part 2) by enforcing type upper bounds ( souce code ).
- Step 8: putting it all together. Designing a suitable hierarchy; an example of generic programming: Containers, Iterators and generic algorithms ( souce code ).