Skip to content

Object-Oriented Programming (OOP)

Which concept is defined as follows: a design principle in which a class is built using instances of other classes as components, forming a 'has-a' relationship?

Difficulty: Hard

About this MCQ

This Hard Object-Oriented Programming (OOP) MCQ checks one syllabus fact.

The question is: “Which concept is defined as follows: a design principle in which a class is built using instances of other classes as components, forming a 'has-a' relationship?”

The accepted answer is C. Composition. Composition is the person body or term that satisfies Which concept is defined as follows a design principle in which a class is built using instances of other classes as components forming a 'has-a' relationship option C Option A Association does not match the stem it is a near-miss used to catch incomplete recall of Composition Option B Access modifier does not match the stem it is a near-miss used to catch incomplete recall of Composition Remaining alternatives Instance variable fall outside the same rule and should be eliminated once Composition 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 regular item in FPSC.

Correct answer

C. Composition

Explanation

Composition is the person body or term that satisfies Which concept is defined as follows a design principle in which a class is built using instances of other classes as components forming a 'has-a' relationship option C Option A Association does not match the stem it is a near-miss used to catch incomplete recall of Composition Option B Access modifier does not match the stem it is a near-miss used to catch incomplete recall of Composition Remaining alternatives Instance variable fall outside the same rule and should be eliminated once Composition 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 regular item in FPSC.

Source: Object-Oriented Programming (OOP) Official Reference Guide

Tags: computer science, oop, object-oriented programming, software design

Submitted by: MCQsHub Editorial

Related MCQs

More Object-Oriented Programming (OOP) MCQs