Computer Science 225
Advanced Programming
Spring 2022, Siena College
Lecture 5: Inheritance
Date: Friday, February 11, 2022
Agenda
- Announcements
- 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
- commit often with meaningful messages (small penalties for
not), push often, and the programming project tasks will also be
evaluated for style, documentation, etc.
- open Issues to request early checks
- keep adding VSCode tips to the shared document I sent out, and
check it for things that will make your VSCode life easier
- form teams and get in on the programming contest next Thursday
- your bonus for participating will be a one-time 24-hour
reduction on the late penalty for a problem set
- contact Dr. Lim to sign up
- Being a good lab partner
- Overloaded methods
- Inheritance
- terminology
- a simple example
- protected and default protection
- java.lang.Object and the superclass hierarchy
- UML class diagrams
- subtypes
- overriding
Terminology
- inheritance
- overloading
- ad hoc polymorphism
- subclass/extended class
- superclass/base class
- extends
- derived class
- IS-A association
- specialization
- subtype
- type conversion
- widening conversion
- narrowing conversion/downcasting
- subtype polymorphism
- override
- dynamic binding of method calls
Examples
Links