Homework Review!
- Go over it, and see how it illustrates the need for
multiple inheritance ... and how the limited form of multiple
inheritance we get from interfaces is "good enough".
Project Review!
- Don't use tyr-catch where you really mean if-else.
- Do use try catch to detect problems (and throw
exceptions) where they really cause problems, e.g. detect
character problems in Caesar not in main.
- Don't forget to make functions for all the good reasons
that we did in IC210 - avoid duplicate code, break out
non-trivial steps into functions, where you can test, debug
and puzzle through a solution in isolation from the rest of
the big program.
- Don't duplicate code. When you see duplicate code, it
generally means poor design.
Review!
- The purpose of iterators.
- Polymorphism: with reference
Foo x,
how do you figure out what methods you can call?
-
Inheritance: if class Bar extends Foo, and you have
references Foo x andBar y, why is it that "x = y" is OK, but
"y = x" is not? Even if x actually does refer to an object
of type Bar?
-
OOP design reprise: class hierarchies + polymorphism rather
than fields indicating type and if-else's at the calling site.
-
Exceptions: how do we use inheritance and polymorphism
to send information about an error from the place where it
was detected to the place where it can be dealt with.
-
Does Java support multiple inheritance?
-
Understand the purpose of generics and how it differs from
simply using a common base type (like object).