CS 448 Lecture - Java abstraction and coding
Topics for today:
- Reading --C11, C12: Active symbols, levels, emergence, reductionism, unnatural selection
- Coding!
- Principles
- Legible, Flexible, Robust
- A class shouldn't know anything it doesn't have to. Huh?
- Some examples
- Debug
- PtronRunner: initializing arrays
- PatternList
- Ptron1 & Util
- Util again (a rewrite of Util using PatternList
- Groups: a Minimaxible interface
- Want to write a Move minimax(Minimaxible) method that would work for any game that implements Minimaxible
- What methods will your minimax method need?
- Enter your interface in /home/dante/faculty/levenick/public_html/cs448/examplesFromClass/MinimaxibleExercise/src/MinimaxibleN (where N is your group number) so we can all look at them
- Abstract classes in Java
- Makes it possible to abstract commonalities from two (or more) classes.
- Like interface, makes it possible to require certain methods to be implemented. Each signature is preceded by abstract; each must be overridden in subclasses (which
are not themselves abstract).
- Methods may be implemented in the abstract class; if they are not overridden in a subclass when sent to the subclass object the superclass method is executed.
- Can declare variables in abstract classes
- Cannot instantiate!
- Classes may only extend one other class
- Parameter types may be abstract
- Vehicles demo?
- Learning to play go?