Polymorphism with Abstract Interfaces
CS2 / Java
This activity introduces abstract interfaces in Java in the context of Polymorphism and draws parallels to the concept of inheritance. The concept of Polymorphism via inheritance is first reviewed, in a scenario where inheritance is not the most appropriate solution. An improved solution via an abstract interface is then explored and analyzed. At the end of the activity the students compare and contrast the use of inheritance versus abstract interfaces. After completing this activity, the students will be able to explain the concept of an abstract interface in Java, use abstract interfaces to achieve polymorphism, and describe the differences between a class and an abstract interface.
This activity was developed with NSF support through IUSE-1626765. You may request access to this activity via the following link: IntroCS-POGIL Activity Writing Program.
Setting: computer classroom
Activity type: Learning Cycle
Discipline: Computer Science
Course: CS2 / Java
Keywords: interfaces, polymorphism
How to Cite
Copyright of this work and the permissions granted to users of the PAC are defined in the PAC Activity User License.