Fiveable
Fiveable

Polymorphism

Definition

Polymorphism refers to the ability of objects to take on multiple forms or have multiple types. In programming, it allows different objects to be treated as instances of a common superclass, enabling flexibility and extensibility.

Related terms

Method Overriding: Method overriding occurs when a subclass provides its own implementation for a method that is already defined in its superclass. This allows for customization of behavior specific to each subclass.

Dynamic Binding: Dynamic binding refers to determining which implementation of an overridden method should be called at runtime based on the actual type of the object rather than its declared type. It allows for flexibility in method invocation.

Interface: An interface is a collection of abstract methods that define a contract for classes to implement. It enables polymorphism by providing a common set of methods that different classes can implement.

"Polymorphism" appears in:

Study guides (3)

  • AP Computer Science A - 9.5 Creating References Using Inheritance Hierarchies

  • AP Computer Science A - 9.6 Polymorphism

  • AP Computer Science A - 10.2 Recursive Searching and Sorting

Additional resources (2)

  • AP Computer Science A - Unit 2 Overview: Using Objects

  • AP Computer Science A - 9.1 Creating Superclasses and Subclasses

Practice Questions (1)

  • What is polymorphism in object-oriented programming?

collegeable - rocket pep

Are you a college student?

  • Study guides for the entire semester

  • 200k practice questions

  • Glossary of 50k key terms - memorize important vocab


Fiveable
About Us

About Fiveable

Blog

Careers

Code of Conduct

Terms of Use

Privacy Policy

CCPA Privacy Policy

Resources

Cram Mode

AP Score Calculators

Study Guides

Practice Quizzes

Glossary

Cram Events

Merch Shop

Crisis Text Line

Help Center

Stay Connected


© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.

About Us

About Fiveable

Blog

Careers

Code of Conduct

Terms of Use

Privacy Policy

CCPA Privacy Policy

Resources

Cram Mode

AP Score Calculators

Study Guides

Practice Quizzes

Glossary

Cram Events

Merch Shop

Crisis Text Line

Help Center

© 2024 Fiveable Inc. All rights reserved.

AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.