Skip to content

Object-Oriented Programming (OOP)

Select the correct name for: a keyword that controls the visibility and accessibility of a class's members, such as public or private.

Difficulty: Medium

About this MCQ

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

The question is: “Select the correct name for: a keyword that controls the visibility and accessibility of a class's members, such as public or private.”

The accepted answer is D. Access modifier. “Select the correct name for: a keyword that controls the visibility and accessibility of a class's members, such as public or private.” is answered by Access modifier (option D). Option A (“Message passing”) does not match the stem; it is a near-miss used to catch incomplete recall of Access modifier. Option B (“Destructor”) does not match the stem; it is a near-miss used to catch incomplete recall of Access modifier. Remaining alternatives (Instance variable) fall outside the same rule and should be eliminated once Access modifier 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, PPSC, NTS, and CSS papers.

Correct answer

D. Access modifier

Explanation

“Select the correct name for: a keyword that controls the visibility and accessibility of a class's members, such as public or private.” is answered by Access modifier (option D). Option A (“Message passing”) does not match the stem; it is a near-miss used to catch incomplete recall of Access modifier. Option B (“Destructor”) does not match the stem; it is a near-miss used to catch incomplete recall of Access modifier. Remaining alternatives (Instance variable) fall outside the same rule and should be eliminated once Access modifier 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, PPSC, NTS, and CSS papers.

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