Computer Science 225
Advanced Programming
Spring 2021, Siena College
Lecture 3: Java Interfaces
Date: Monday, March 1, 2021
Agenda
- Announcements
- Upcoming substitute lab instructors and remote/online lecture meetings
- this week's labs will be run by some excellent substitute instructors
- Friday's lecture will be online synchronous
- next Monday's lecture will be online asynchronous, watch for info
- office hours are cancelled for Wednesday and Thursday,
remote only through next Tuesday (most likely)
- I expect to be back on campus a week from Wednesday and
Thursday for our Lab 3 meetings
- Problem Set 1 due tonight
- however, I will accept submissions through Tuesday night
without penalty
- please continue to create Issues for each problem as you
have it ready for testing - don't wait until you have them all done!
- a video discussing sample solutions will be made available
soon
- Lab 1: Java and Data Structures Refresher (in Canvas and GitHub) due 24
hours before your lab meeting this week
- I will continue to check your documents periodically, you
can email or tag me to request a quicker look
- Finalizing setup for Lab 2: Java Interfaces (in Canvas and GitHub)
- Wrapping up Lecture 2 in-class
- Wrapping up the "Java You Know" recap, including running BuildingStrings
- Java Interfaces
- motivation
- implementing existing interfaces
- creating interfaces
- anonymous classes
- In-class exercise (2 assignment points, put in the same shared document from In-class 2)
- 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