adplus-dvertising

Welcome to the Constructors and Destructors MCQs Page

Dive deep into the fascinating world of Constructors and Destructors with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Constructors and Destructors, a crucial aspect of Object Oriented Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Constructors and Destructors, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within Object Oriented Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Constructors and Destructors. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of Object Oriented Programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Constructors and Destructors. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Constructors and Destructors MCQs | Page 2 of 9

Q11.
Which object will be created first?
class student 
{  
    int marks;
};
student s1, s2, s3;
Discuss
Answer: (a).s1 then s2 then s3
Discuss
Answer: (d).Explicit call to a constructor
Q13.
Which among the following is correct for the class defined below?
class student
{
 int marks;
 public: student(){}
 student(int x)
 { 
  marks=x; 
 }
};
main()
{
student s1(100);
student s2();
student s3=100;
return 0;
Discuss
Answer: (c).Program runs and all objects are created
Q14.
For constructor overloading, each constructor must differ in ___________ and __________
Discuss
Answer: (a).Number of arguments and type of arguments
Q15.
How many types of constructors are available, in general, in any language?

a.

2

b.

3

c.

4

d.

5

Discuss
Answer: (b).3
Q16.
Choose the correct option for the following code.
class student
{
    int marks;
}
student s1;
student s2=2;
Discuss
Answer: (d).Program gives compile time error
Q17.
Which constructor is called while assigning some object with another?
Discuss
Answer: (c).Copy
Discuss
Answer: (a).Constructor is not called in pass by reference
Q19.
Which specifier applies only to the constructors?
Discuss
Answer: (d).Explicit
Discuss
Answer: (c).Default constructor can be called explicitly
Page 2 of 9

Suggested Topics

Are you eager to expand your knowledge beyond Object Oriented Programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!