Object-Oriented Programming (OOP)
Select the accurate description of Interface.
Difficulty: Hard
About this MCQ
This Hard Object-Oriented Programming (OOP) MCQ checks one syllabus fact.
The question is: “Select the accurate description of Interface.”
The accepted answer is C. A contract that defines a set of methods a class must implement without specifying how.. Interface refers to a contract that defines a set of methods a class must implement without specifying how.
- A. The ability to define multiple methods with the same name but different parameters in a class.
Why not A: “The ability to define multiple methods with the same name but different parameters in a class.” is not correct. The accepted answer is C. A contract that defines a set of methods a class must implement without specifying how.. Interface refers to a contract that defines a set of methods a class must implement without specifying how.
- B. An OOP mechanism that allows a class to acquire properties and behaviors from another class.
Why not B: “An OOP mechanism that allows a class to acquire properties and behaviors from another class.” is not correct. The accepted answer is C. A contract that defines a set of methods a class must implement without specifying how.. Interface refers to a contract that defines a set of methods a class must implement without specifying how.
- C. A contract that defines a set of methods a class must implement without specifying how. ✓
- D. A reference used within a class to refer to the current instance of the object.
Why not D: “A reference used within a class to refer to the current instance of the object.” is not correct. The accepted answer is C. A contract that defines a set of methods a class must implement without specifying how.. Interface refers to a contract that defines a set of methods a class must implement without specifying how.
Correct answer
C. A contract that defines a set of methods a class must implement without specifying how.
Explanation
Interface refers to a contract that defines a set of methods a class must implement without specifying how.
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 special method automatically invoked when an object is destroyed, used to release resou...
- Identify the correct definition of Destructor.
- What term describes the following? a class member that belongs to the class itself rather than to any individu...
- In computer science, Static member refers to which of the following?
- Select the correct name for: a keyword that controls the visibility and accessibility of a class's members, su...
- Which statement correctly explains Access modifier?