Polymorphism with Abstract Interfaces

CS2 / Java

Authors

  • Kate Holdener Saint Louis University

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

2023-01-08

How to Cite

Holdener, K. (2023). Polymorphism with Abstract Interfaces: CS2 / Java. POGIL Activity Clearinghouse, 3(4). Retrieved from https://pac.pogil.org/index.php/pac/article/view/289

Issue

Section

CS-POGIL Activity Writing Program