Object-Oriented Programming (OOP)
What term describes the following? a special method automatically called when an object of a class is created, used to initialize it.
Difficulty: Medium
About this MCQ
This Medium Object-Oriented Programming (OOP) MCQ checks one syllabus fact.
The question is: “What term describes the following? a special method automatically called when an object of a class is created, used to initialize it.”
The accepted answer is B. Constructor. Constructor refers to a special method automatically called when an object of a class is created, used to initialize it.
- A. Class
Why not A: “Class” is not correct. The accepted answer is B. Constructor. Constructor refers to a special method automatically called when an object of a class is created, used to initialize it.
- B. Constructor ✓
- C. Interface
Why not C: “Interface” is not correct. The accepted answer is B. Constructor. Constructor refers to a special method automatically called when an object of a class is created, used to initialize it.
- D. Abstract class
Why not D: “Abstract class” is not correct. The accepted answer is B. Constructor. Constructor refers to a special method automatically called when an object of a class is created, used to initialize it.
Correct answer
B. Constructor
Explanation
Constructor refers to a special method automatically called when an object of a class is created, used to initialize it.
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?