Three types of Interfaces
Advantages of Using Interfaces
The students will be able to define the three types of Interfaces in Java. Students will be able to describe the value of using an Interface. Students will also be able to implement an Interface in a class.
Possible labs for teaching interfaces are Clock Interface Lab and Gradebook Lab.
Gradebook lab has different folders marked A, B, and C for students with differing levels of expertise. Level A is for high-scoring students and provide the least amount of starter code.
Describe how Japanese and Chinese teams of engineers can cooperate on the development of a remote control for a projector system. Show how the compiler can be used to help assure that no methods are left unwritten.
Review Abstract Base Classes briefly. Describe the difference between ABCs and Interfaces in Java.
Different types of Interfaces in Java:
Marker Interfaces (Zero Abstract Methods)
Functional Interfaces (Exactly One Abstract Method)
Normal Interfaces (More Than One Abstract Method)
Functional Interfaces were previously called "Single Abstract Method Interfaces" or SAMs. The name was changed because of the software community's adoption of the word "functional" to describe the new programming paradigm.
Example of Marker Interface: Serializable
Example of Functional Interface: Comparator (will be taught in the next lesson)
Example of Normal Interface: Remote Control (example from last year)