Object-Oriented Programming (OOP)
Identify the correct concept described as: a variable defined in a class for which each object of that class maintains its own separate copy.
Difficulty: Medium
About this MCQ
This Medium Object-Oriented Programming (OOP) MCQ checks one syllabus fact.
The question is: “Identify the correct concept described as: a variable defined in a class for which each object of that class maintains its own separate copy.”
The accepted answer is A. Instance variable. Identify the correct concept described as a variable defined in a class for which each object of that class maintains its own separate copy is answered by Instance variable option A Option B Data hiding does not match the stem it is a near-miss used to catch incomplete recall of Instance variable Option C Super keyword does not match the stem it is a near-miss used to catch incomplete recall of Instance variable Remaining alternatives Message passing fall outside the same rule and should be eliminated once Instance variable 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.
- A. Instance variable ✓
- B. Data hiding
Why not B: “Data hiding” is not correct. The accepted answer is A. Instance variable. Identify the correct concept described as a variable defined in a class for which each object of that class maintains its own separate copy is answered by Instance variable option
- C. Super keyword
Why not C: “Super keyword” is not correct. The accepted answer is A. Instance variable. Identify the correct concept described as a variable defined in a class for which each object of that class maintains its own separate copy is answered by Instance variable option
- D. Message passing
Why not D: “Message passing” is not correct. The accepted answer is A. Instance variable. Identify the correct concept described as a variable defined in a class for which each object of that class maintains its own separate copy is answered by Instance variable option
Correct answer
A. Instance variable
Explanation
Identify the correct concept described as a variable defined in a class for which each object of that class maintains its own separate copy is answered by Instance variable option A Option B Data hiding does not match the stem it is a near-miss used to catch incomplete recall of Instance variable Option C Super keyword does not match the stem it is a near-miss used to catch incomplete recall of Instance variable Remaining alternatives Message passing fall outside the same rule and should be eliminated once Instance variable 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.
Source: Object-Oriented Programming (OOP) Official Reference Guide
Tags: computer science, oop, object-oriented programming, software design
Submitted by: MCQsHub Editorial
Related MCQs
- What is the name for a mechanism where the method to be executed is determined at compile time based on the ob...
- A design pattern that restricts the instantiation of a class to a single shared object. What is this concept c...
- What does Dynamic binding refer to?
- Choose the correct description of Singleton pattern.
- Which term refers to a mechanism where the method to be executed is determined at runtime rather than at compi...
- Which of the following best names the concept in which the process by which objects communicate with one anoth...