Difficulty: Medium
Correct Answer: 3 (default constructor, parameterised constructor and copy constructor are commonly counted).
Explanation:
Introduction / Context:
Constructors are special member functions used to initialise objects in C++. Textbooks and exam questions often talk about basic kinds of constructors, which helps students learn the different ways objects can be created. This question asks how many basic constructor types are traditionally listed and expects that you know the common classification rather than every advanced variation defined by the standard.
Given Data / Assumptions:
Concept / Approach:
A default constructor can be called without arguments and creates a default initialised object. A parameterised constructor takes one or more arguments that control how the object is initialised. A copy constructor takes a reference to another object of the same type and constructs a new object as a copy of that object. Together, these three categories cover the most common ways that C++ classes initialise objects and are frequently highlighted in interview and exam questions as the basic kinds of constructors.
Step-by-Step Solution:
Step 1: List the basic constructor types taught in many C++ courses: default, parameterised and copy constructors.Step 2: Count these categories, which gives the number three.Step 3: Option C states that there are 3 basic kinds and even names them.Step 4: Options A and B suggest fewer categories, which would require grouping different behaviours together.Step 5: Option D and option E are clearly incorrect because C++ does have constructors and the standard does not require four or more basic kinds in every classification.
Verification / Alternative check:
If you open typical C++ textbooks or interview preparation material, you will often see a section titled types of constructors with three bullet points: default, parameterised and copy. Move constructors are usually introduced later when discussing C++11 and beyond. For exam style questions, setters expect the answer three unless move constructors are explicitly included as a separate category in the question stem, which is not the case here.
Why Other Options Are Wrong:
Option A and option B do not match the widely used breakdown and would leave out at least one of the classic constructor types. Option D claims that four or more kinds are mandatory, which does not match common teaching nor the intent of this question. Option E is completely wrong because constructors are a fundamental part of C++ class design.
Common Pitfalls:
Students sometimes confuse the number of constructor overloads in a specific class with the conceptual categories of constructors. A single class can have many overloaded constructors, but they still fall into these basic groups. Also, do not forget that modern C++ adds move constructors, but for traditional exam questions, three basic types are usually expected as the answer.
Final Answer:
3 (default constructor, parameterised constructor and copy constructor are commonly counted).
Discussion & Comments