Asked by Madhur Miglani on Sep 26, 2024

verifed

Verified

Assigning an object of an ancestor class to a descendent class is called:

A) static binding
B) dynamic binding
C) upcasting
D) downcasting

Downcasting

The process of converting a reference of a parent class to a reference of a child class in the object hierarchy.

Ancestor Class

A class from which another class is derived, either directly or through one or more levels of inheritance.

Descendent Class

A class in object-oriented programming that inherits properties and methods from one or more base classes, also known as a subclass.

  • Acquire knowledge on the method and impacts of upcasting and downcasting within the realm of object orientation.
verifed

Verified Answer

HS
huang shizheabout 13 hours ago
Final Answer :
D
Explanation :
Downcasting refers to casting an object of a parent class to one of its subclass types. This is often done to access more specific methods that are not available in the parent class type.