Computer Science 225
Advanced Programming
Spring 2021, Siena College
Lecture 6: Inheritance
Date: Friday, March 12, 2021
Agenda
- Announcements
- Back in RB 328!
- Lab 3: Introduction to Java Swing (in Canvas and GitHub) mostly done
- finish up at least 24 hours before your lab next week
- drop me and email or open an Issue when you'd like me to
check on anything, including the bonus functionality (which is a
pretty easy 10 points once you've gotten the rest of the code
working)
- Problem Set 2 continues
- a couple of details have been added to the document,
including sample output for SyracuseSearch
- commit often with meaningful messages (small penalties for
not), push often, and the programming project tasks will also be
evaluated for style, documentation, etc.
- More Inheritance
- a look back at the first inheritance example
- java.lang.Object and the superclass hierarchy
- UML class diagrams
- subtypes
- overriding
- In-class exercises (we might not get to all today, 5 points
total) - see email for link to create a repository
- an Iterator that reverses the output order of another Iterator
- an Iterator that sorts the output order of another Iterator based on a Comparator
- an Iterator that returns values produced by another Iterator filtered by a predicate function
Terminology
- specialization
- subtype
- type conversion
- widening conversion
- narrowing conversion/downcasting
- subtype polymorphism
- override
- dynamic binding of method calls
Examples
- ColorPoint: simple inheritance example
- Overriding: demonstration of method overriding in derived classes
Links