Object-Oriented Programming (OOP)
What is Method overriding primarily used for?
Difficulty: Medium
About this MCQ
This Medium Object-Oriented Programming (OOP) MCQ checks one syllabus fact.
The question is: “What is Method overriding primarily used for?”
The accepted answer is C. The ability of a subclass to provide a specific implementation of a method already defined in its parent class.. Method overriding refers to the ability of a subclass to provide a specific implementation of a method already defined in its parent class.
- A. A reference used within a class to refer to the current instance of the object.
Why not A: “A reference used within a class to refer to the current instance of the object.” is not correct. The accepted answer is C. The ability of a subclass to provide a specific implementation of a method already defined in its parent class.. Method overriding refers to the ability of a subclass to provide a specific implementation of a method already defined in its parent class.
- B. An instance of a class that contains actual values for the properties defined by the class.
Why not B: “An instance of a class that contains actual values for the properties defined by the class.” is not correct. The accepted answer is C. The ability of a subclass to provide a specific implementation of a method already defined in its parent class.. Method overriding refers to the ability of a subclass to provide a specific implementation of a method already defined in its parent 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.
Why not D: “An OOP feature where a class can inherit properties and behaviors from more than one parent class.” is not correct. The accepted answer is C. The ability of a subclass to provide a specific implementation of a method already defined in its parent class.. Method overriding refers to the ability of a subclass to provide a specific implementation of a method already defined in its 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.
Source: Object-Oriented Programming (OOP) Official Reference Guide
Tags: computer science, oop, object-oriented programming, software design
Submitted by: MCQsHub Editorial
Related MCQs
- The concept in which a special method automatically invoked when an object is destroyed, used to release resou...
- Identify the correct definition of Destructor.
- What term describes the following? a class member that belongs to the class itself rather than to any individu...
- In computer science, Static member refers to which of the following?
- Select the correct name for: a keyword that controls the visibility and accessibility of a class's members, su...
- Which statement correctly explains Access modifier?