Polymorphism with Abstract Interfaces
CS2 / Java
Abstract
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.
Level: undergraduate
Setting: computer classroom
Activity type: Learning Cycle
Discipline: Computer Science
Course: CS2 / Java
Keywords: interfaces, polymorphism
Downloads
Published
How to Cite
Issue
Section
License
Copyright of this work and the permissions granted to users of the PAC are defined in the PAC Activity User License.