Object-Oriented Programming (OOP)
The following statement describes a specific concept. What is it called? a contract that defines a set of methods a class must implement without specifying how.
Difficulty: Hard
About this MCQ
This Hard Object-Oriented Programming (OOP) MCQ checks one syllabus fact.
The question is: “The following statement describes a specific concept. What is it called? a contract that defines a set of methods a class must implement without specifying how.”
The accepted answer is A. Interface. The following statement describes a specific concept What is it called a contract that defines a set of methods a class must implement without specifying how is answered by Interface option A Option B This self keyword does not match the stem it is a near-miss used to catch incomplete recall of Interface Option C Method overriding does not match the stem it is a near-miss used to catch incomplete recall of Interface Remaining alternatives Abstraction fall outside the same rule and should be eliminated once Interface 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.
- A. Interface ✓
- B. This/self keyword
Why not B: “This/self keyword” is not correct. The accepted answer is A. Interface. The following statement describes a specific concept What is it called a contract that defines a set of methods a class must implement without specifying how is answered by Interfa
- C. Method overriding
Why not C: “Method overriding” is not correct. The accepted answer is A. Interface. The following statement describes a specific concept What is it called a contract that defines a set of methods a class must implement without specifying how is answered by Interfa
- D. Abstraction
Why not D: “Abstraction” is not correct. The accepted answer is A. Interface. The following statement describes a specific concept What is it called a contract that defines a set of methods a class must implement without specifying how is answered by Interfa
Correct answer
A. Interface
Explanation
The following statement describes a specific concept What is it called a contract that defines a set of methods a class must implement without specifying how is answered by Interface option A Option B This self keyword does not match the stem it is a near-miss used to catch incomplete recall of Interface Option C Method overriding does not match the stem it is a near-miss used to catch incomplete recall of Interface Remaining alternatives Abstraction fall outside the same rule and should be eliminated once Interface 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.
Source: Object-Oriented Programming (OOP) Official Reference Guide
Tags: computer science, oop, object-oriented programming, software design
Submitted by: MCQsHub Editorial
Related MCQs
- Which concept is defined as follows: the ability of a subclass to provide a specific implementation of a metho...
- Which term refers to a class that cannot be instantiated on its own and may contain abstract methods to be imp...
- Which statement correctly explains Method overloading?
- What does Abstract class refer to?
- Select the correct name for: the ability to define multiple methods with the same name but different parameter...
- What is the name for an OOP feature where a class can inherit properties and behaviors from more than one pare...