Computer Science 225
Advanced Programming
Spring 2020, Siena College
Lecture 5: Interfaces
Date: Friday, January 31, 2020
Agenda
- Announcements
- Lab 1: Java Interfaces continues
- Problem Set 1 recap will be Monday since the late clock has
not yet gone past 100%
- Problem Set 2 introduction
- Java Interfaces
- motivation
- implementing existing interfaces
- creating interfaces
- anonymous classes
- In-class exercises (5 assignment points)
- Write a method that takes an Iterator<String> as its
only parameter and returns the String that comes first
alphabetically.
Terminology
- interface
- implementing an interface
- object-oriented design
- reusable
- instanceof operator
- cast
- anonymous class
Examples