Object-Oriented Programming (OOP)
What is Method overriding primarily used for?
- A. A reference used within a class to refer to the current instance of the object.
- B. An instance of a class that contains actual values for the properties defined by the class.
- C. The ability of a subclass to provide a specific implementation of a method already defined in its parent class. ✓
- D. An OOP feature where a class can inherit properties and behaviors from more than one parent class.
Correct answer
C. The ability of a subclass to provide a specific implementation of a method already defined in its parent class.
Explanation
Method overriding refers to the ability of a subclass to provide a specific implementation of a method already defined in its parent class.