Object-Oriented Programming (OOP)
What term describes the following? a design guideline suggesting that building complex behavior by combining objects is often preferable to relying solely on class inheritance.
Difficulty: Hard
About this MCQ
This Hard Object-Oriented Programming (OOP) MCQ checks one syllabus fact.
The question is: “What term describes the following? a design guideline suggesting that building complex behavior by combining objects is often preferable to relying solely on class inheritance.”
The accepted answer is C. Composition over inheritance. Composition over inheritance is the fact required by What term describes the following a design guideline suggesting that building complex behavior by combining objects is often preferable to relying solely on class inheritance option C Option A Destructor does not match the stem it is a near-miss used to catch incomplete recall of Composition over inheritance Option B Instance variable does not match the stem it is a near-miss used to catch incomplete recall of Composition over inheritance Remaining alternatives Super keyword fall outside the same rule and should be eliminated once Composition over inheritance is identified Object-Oriented Programming OOP questions of this type reward precise definitions rather than approximate associations Object-Oriented Programming OOP recall of this distinction is a.
- A. Destructor
Why not A: “Destructor” is not correct. The accepted answer is C. Composition over inheritance. Composition over inheritance is the fact required by What term describes the following a design guideline suggesting that building complex behavior by combining objects is often pr
- B. Instance variable
Why not B: “Instance variable” is not correct. The accepted answer is C. Composition over inheritance. Composition over inheritance is the fact required by What term describes the following a design guideline suggesting that building complex behavior by combining objects is often pr
- C. Composition over inheritance ✓
- D. Super keyword
Why not D: “Super keyword” is not correct. The accepted answer is C. Composition over inheritance. Composition over inheritance is the fact required by What term describes the following a design guideline suggesting that building complex behavior by combining objects is often pr
Correct answer
C. Composition over inheritance
Explanation
Composition over inheritance is the fact required by What term describes the following a design guideline suggesting that building complex behavior by combining objects is often preferable to relying solely on class inheritance option C Option A Destructor does not match the stem it is a near-miss used to catch incomplete recall of Composition over inheritance Option B Instance variable does not match the stem it is a near-miss used to catch incomplete recall of Composition over inheritance Remaining alternatives Super keyword fall outside the same rule and should be eliminated once Composition over inheritance is identified Object-Oriented Programming OOP questions of this type reward precise definitions rather than approximate associations Object-Oriented Programming OOP recall of this d...
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 keyword used in a subclass to refer to members or methods of its immediate parent class...
- Select the correct name for: the practice of restricting direct access to an object's internal data to protect...
- What is the function or purpose of Message passing?
- Which of the following best names the concept in which the process by which objects communicate with one anoth...
- Choose the correct description of Singleton pattern.
- A design pattern that restricts the instantiation of a class to a single shared object. What is this concept c...