Skip to main content

2 docs tagged with "polymorphism"

View All Tags

Inheritance and Polymorphism in Java

In this tutorial, we will learn about inheritance and polymorphism in Java. We will learn about how to create subclasses and superclasses, how to use inheritance to reuse code, and how to use polymorphism to create flexible and extensible code in Java.

Polymorphism in C++

In this tutorial, we'll explore polymorphism in C++. We'll delve into how polymorphism allows objects of different derived classes to be treated as objects of a common base class, enabling dynamic method binding and runtime polymorphic behavior. You'll learn about virtual functions, abstract classes, and the use of pointers and references to achieve polymorphic behavior. Understanding polymorphism is crucial for building flexible and extensible C++ programs, facilitating code reuse and enhancing code maintainability and readability.