Constructor questions look like definitions, but their losing options usually exploit one precise distinction: no return type versus void, default construction versus copy construction, declaration versus out-of-class definition, or storage allocation versus object construction. The 12 questions below span syntax, constructor types, copy semantics, array initialization, access control, virtual functions, and new versus malloc. Choose an option and trace the object being created before reading the explanation. For broader programming practice, use the Coding & Skill Development Courses page after completing the set.
C++ constructor rules to trace before solving the MCQs
Start with one class state. Widget() sets (width, height) to (2, 3), Widget(int w, int h) stores the supplied pair, and Widget(const Widget &other) copies it.
Declaration | Constructor call count | Resulting state |
|---|---|---|
| 1 default call |
|
| 1 parameterized call |
|
| 1 copy call |
|
| 3 default calls | 3 objects, each |
The array row matters. Question 9 declares Test t[100];, but only Test(int v) exists. With no zero-argument constructor to call 100 times, compilation fails before output.
Keep four rules beside the trace. A constructor has no return type, and its name matches its class. An out-of-class definition uses ClassName::ClassName(...). Base subobjects are initialized before the derived constructor body. These checks reveal which constructor is available before the options distract you.
C++ constructors MCQs 1-3: syntax, return type and constructor kinds
Question 1 (UGC NET 2016)
Constructors have _____ return type.
A. void
B. char
C. int
D. no
Answer: D. no.
Constructors have no return type, including void. void MyClass() is a member function, so A, B and C are invalid.
Question 2 (UGC NET 2022)
If a constructor 'Date' is declared explicitly and has to be defined outside the class, which of the following is correct?
A.
Date::Date(int dd) {/∗…∗/}B.
explicit Date:: Date(int dd) {/∗…∗/}C. Such a constructor cannot be defined
D. Constructor always has to be defined inside the class
Answer: A. Date::Date(int dd) {/∗…∗/}.
The definition uses ClassName::ClassName(parameter-list). explicit stays on the in-class declaration. C and D are false because constructors may be defined inside or outside the class.
Question 3 (RSSB 2022)
Which of the following is not a type of constructor?
A. Copy constructor
B. Friend constructor
C. Default constructor
D. Parameterized constructor
Answer: B. Friend constructor.
Default, parameterized and copy constructors are recognised forms. Friendship grants access to a function or class; it does not create a friend-constructor category.
Copy and implicit constructors MCQs 4-6
Question 4 (ISRO 2013)
What is the correct way to declare a copy constructor of a class named MyClass?
A.
MyClass(const MyClass *arg)B.
MyClass(const MyClass &arg)C.
MyClass(MyClass arg)D.
MyClass(MyClass *arg)
Answer: B. MyClass(const MyClass &arg).
Passing by reference avoids copying the argument itself. const accepts const sources and prevents mutation. A and D are ordinary pointer-taking constructors, while C creates a recursive copy requirement.
Question 5 (KVS 2013)
Which constructor will be called by the following lines of code?
(i) Student S1;
(ii) Student S2 = S1
A. First copy constructor, then default constructor.
B. First default constructor, then copy constructor.
C. Default constructors for both lines of code.
D. Copy constructors for both lines of code.
Answer: B. First default constructor, then copy constructor.
Trace two object births. Student S1; has no source or argument, so it default-constructs S1. Student S2 = S1 creates S2 from S1, invoking the copy constructor rather than assignment.
Question 6 (BPSC 2023)
Which of the following constructors can be provided implicitly by the
C++ compiler
if they are not defined in a class?
A. Copy constructor
B. Default constructor
C. Parameterized constructor
D. More than one of the above
E. None of the above
Answer: D. More than one of the above.
The compiler may implicitly declare default and copy constructors, so A and B make D correct. It creates no parameterized constructor. Other declarations can suppress or delete an implicit special member.
Object creation, access and array initialization MCQs 7-9
Question 7 (BPSC 2023)
A constructor is called whenever
A. an object is created
B. a class is created
C. a class is declared
D. More than one of the above
E. None of the above
Answer: A. an object is created.
A class definition describes a type; object creation begins an instance's lifetime. Its constructor runs then, while declaring or defining the class constructs nothing.
Question 8 (BPSC 2024)
In which access should a constructor be defined, so that object of the class can be created in any function?
A. Public
B. Private
C. Protected
D. More than one of the above
E. None of the above
Answer: A. Public.
A public constructor is accessible from arbitrary functions, matching “any function”. Private and protected constructors control creation, but unrelated functions need another access mechanism such as friendship.
Question 9 (Hexaware 2024)
#include <iostream>
using namespace std;
class Test {
int value;
public:
Test(int v);
};
Test::Test(int v) {
value = v;
}
int main() {
Test t[100];
return 0;
}A. Compiler error
B. 100
C. 118
D. 0
Answer: A. Compiler error.
Test t[100] needs a callable Test() for all 100 elements. Only Test(int v) exists, with no argument supplied, so compilation fails before return or output. Widget batch[3] worked because Widget() existed.
Virtual functions and dynamic allocation MCQs 10-12
Question 10 (NVS 2019)
Which of the following statements related to C++ is FALSE?
A. Destructors have the same name as their class, preceded by a tilde (~) character.
B. Destructors can be virtual, but constructors cannot.
C. Constructors have neither “return” value nor “void”.
D. Constructors can be virtual, but destructors cannot.
Answer: D. Constructors can be virtual, but destructors cannot.
Virtual dispatch requires an established object, so constructors cannot be virtual. A virtual base destructor lets deletion through a base pointer run the derived-to-base destruction chain. A, B and C are valid.
Question 11 (DSSSB 2018)
Identify the correct statements.
(i) Derived classes do not inherit or overload constructors or destructors from their base classes.
(ii) Destructors can be declared with the keyword virtual.
(iii) Constructors can be declared with the keyword virtual.
A. (i) and (iii) only
B. (i) and (ii) only
C. (ii) and (iii) only
D. (i), (ii) and (iii)
Answer: B. (i) and (ii) only.
Under the conventional framing, (i) is correct, destructors may be virtual, and constructors may not. Thus (i) and (ii) hold. C++11's using Base::Base exposes selected base constructors, but neither makes them virtual nor inherits destructors.
Question 12 (BPSC 2023)
Which of the following statements about new and malloc are true?
I. 'new' is an operator while 'malloc' is a function.
II. 'new' invokes a constructor, whereas 'malloc' does not invoke a constructor.
III. 'malloc' returns a void pointer and needs to be typecast, whereas 'new' returns a pointer of the required type.
A. Only I
B. Both I and II
C. Both II and III
D. More than one of the above
E. None of the above
Answer: D. More than one of the above.
All three statements are true. new is an operator that allocates storage, constructs the object and returns the requested pointer type. malloc is a function returning raw void* storage without construction. B and C are true subsets, so D is correct. Pair new with delete, and malloc with free.
Constructor traps these 12 MCQs expose
Trap to separate | Questions |
|---|---|
No return type, not | Q1 |
Declaration versus out-of-class definition | Q2 |
Default versus copy construction | Q4-Q6 |
Class declaration versus object creation, then array constructor availability | Q7 and Q9 |
Virtual destructor versus non-virtual constructor | Q10-Q11 |
Raw allocation versus object construction | Q12 |
Use a 30-second trace: circle the object, write the constructor signature, then check argument count and access. For Q9, calculate 100 elements x 1 required zero-argument call = 100 unavailable calls. Last, decide whether the option describes compilation, construction or runtime output.
C++ constructors MCQs: the next practice step
Retake Q2, Q5, Q6, Q9, Q11 and Q12 without looking. Together they test scope resolution, copy initialization, implicit special members, arrays, virtual rules, and construction versus allocation. For every rejected option, write one sentence explaining why it fails.
The short version is to identify whether a new object is being created, then match the available constructor by name, arguments, access and source object. Repeat that check for every array element, initialize base state before derived state, and never assume raw storage means that construction occurred. The C++ Programming Course is the structured route for concept lessons and more C++ MCQs. If you want to extend this into C, C++, Java and Python placement practice, continue with Coding for Placements. Then come back and solve the six-question retest from a blank page.




