Mar 28: Polymorphism Lab
Learning Objectives
After today's class, you should be able to:
- Describe the polymorphic algorithms provided by the Java library.
- Implement the
Comparable
interface to allow objects to be sorted. - Identify what objects can be assigned to what types of variables.
Reminders¶
- By Friday 11pm: Do the Week 10 reading and take Quiz08
- By Monday 11pm: Submit HW 8 Part A (5 files, 40 pts)
Lesson Outline¶
Group Activity [25 min]
- Interfaces and Abstract Classes
- Notice that
abstract
classes/methods are in italics
Mini Lecture [10 min]
- Lesson: Algorithms (sorting, searching, etc.)
- Java utility classes: Arrays and Collections
- Example: Algorithms.java and Card.java
- Works because Card implements Comparable
- Notice
Card
is comparable to otherCard
objects
Lab08 [40 min]