Interview Questions Answers.ORG
Interviewer And Interviewee Guide
C++ Pointers & FunctionsC++ Operator OverloadingC++ Exception HandlingC++ Virtual FunctionsC++ Template Interviews Quizzes

Accounts

AccountingAccounts PayableAuditJunior AccountantSenior Accountant

Analysis

Data AnalystFinancial AnalystGISGIS AnalysisStatistics

Banking

ICICI Bank LtdLoan OfficerRecovery OfficerTreasuryUnderwriter

Basic Job

BehavioralBusiness intelligenceFreshers GraduatePuzzlesTargeted Selection

Best Engineering

Automobile EngineeringChemical EngineeringCivil EngineeringElectrical EngineeringMechanical Engineering

Best Multimedia

3D AnimationCoreldrawDesign EngineerGraphics DesignerInterior Design

Community

Cable OperatorFirefighter SpecialistFuneral DirectorSpeech PathologistTranslator

New Artist

Art DirectorAstrologistInternational RelationshipSociologyVisual Arts

9th Class

9th Class Biology9th Class Chemistry9th Class Computer Studies9th Class Pakistan StudiesEnglish Grammar Section 9th Class

Accounting

Accounting ManagementBank Probationary Officer (PO)Financial Accounting Exam MCQsManagerial Accounting Exam MCQs

Civil Engineering

Building ConstructionRailwaysRCC Structures DesignSoil Mechanics and Foundation EngineeringSurveying

Engineering

Electrical EngineeringElectronic DevicesElectronics EngineeringEngineering MechanicsSoftware Engineering

General Knowledge (GK)

General Knowledge (GK)IQ (Intelligence Quotient)Permutation And CombinationPhysical CommunicationVocabulary

Information Technology (IT)

Basics of ComputerComputer KnowledgeComputer OrganizationFundamentals Of ComputerWireless Communication

Networking

Advanced NetworkingBasic NetworkingComputer Networks TestNetwork SecurityNetworking

Soft Skills Quizzes MCQs

Communication Skills Exam MCQsCorporate Communication Exam MCQsLeadership Skills Exam MCQsNegotiation Skills Exam MCQsTime Management Exam MCQs

C Plus Plus Language Interviews

C++ Access Control IQC++ COM ActiveX IQC++ Constructors IQC++ Containers IQC++ Exception Handling IQC++ Friend IQC++ Inheritance IQC++ Inline Function IQC++ New And Delete IQC++ Operator Overloading IQC++ Pointers & Functions IQC++ Programmer IQC++ References IQC++ Static Data IQC++ Syntax IQC++ Template IQC++ Type Checking IQC++ Virtual Functions IQ

Professional C++ Constructors Interview Questions & Answers:

1. Which of the following statement is correct?

A. Destructor destroys only integer data members of the object.
B. Destructor destroys only float data members of the object.
C. Destructor destroys only pointer data members of the object.
D. Destructor destroys the complete object.

Option D
Destructor destroys the complete object.

2. How many default constructors per class are possible?

A. Only one
B. Two
C. Three
D. Unlimited

Option A
Only one

3. Which of the following statement is correct about destructors?

A. A destructor has void return type.
B. A destructor has integer return type.
C. A destructor has no return type.
D. A destructors return type is always same as that of main().

Option C
A destructor has no return type.

4. Which of the following cannot be declared as virtual?

A. Constructor
B. Destructor
C. Data Members
D. Both A and C

Option D
Both A and C

5. Which of the following are NOT provided by the compiler by default?

A. Zero-argument Constructor
B. Destructor
C. Copy Constructor
D. Copy Destructor

Option D
Copy Destructor

6. If the copy constructor receives its arguments by value, the copy constructor would

A. call one-argument constructor of the class
B. work without any problem
C. call itself recursively
D. call zero-argument constructor

Option C
call itself recursively

7. Which of the following statement is correct?

A. A destructor has the same name as the class in which it is present.
B. A destructor has a different name than the class in which it is present.
C. A destructor always returns an integer.
D. A destructor can be overloaded.

Option A
A destructor has the same name as the class in which it is present.

8. Constructors __________ to allow different approaches of object construction.

A. cannot overloaded
B. can be overloaded
C. can be called
D. can be nested

Option B
can be overloaded

9. A __________ is a constructor that either has no parameters, or if it has parameters, all the parameters have default values.

A. default constructor
B. copy constructor
C. Both A and B
D. None of these

Option A
default constructor

10. If the programmer does not explicitly provide a destructor, then which of the following creates an empty destructor?

A. Preprocessor
B. Compiler
C. Linker
D. main() function

Option B
Compiler

11. It is a __________ error to pass arguments to a destructor.

A. logical
B. virtual
C. syntax
D. linker

Option C
syntax

12. __________ used to make a copy of one class object from another class object of the same class type.

A. constructor
B. copy constructor
C. destructor
D. default constructor

Option B
copy constructor

13. A union that has no constructor can be initialized with another union of __________ type.

A. different
B. same
C. virtual
D. class

Option B
same

14. A function with the same name as the class, but preceded with a tilde character (~) is called __________ of that class.

A. constructor
B. destructor
C. function
D. object

Option B
destructor

15. Which of the following never requires any arguments?

A. Member function
B. Friend function
C. Default constructor
D. const function

Option C
Default constructor

16. Which of the following gets called when an object goes out of scope?

A. constructor
B. destructor
C. main
D. virtual function

Option B
destructor

17. Destructor calls are made in which order of the corresponding constructor calls?

A. Reverse order
B. Forward order
C. Depends on how the object is constructed
D. Depends on how many objects are constructed

Option A
Reverse order

18. A destructor takes __________ arguments.

A. one
B. two
C. three
D. no

Option D
no

19. Which of the following implicitly creates a default constructor when the programmer does not explicitly define at least one constructor for a class?

A. Preprocessor
B. Linker
C. Loader
D. Compiler

Option D
Compiler

20. Which of the following statement is correct?

A. A constructor has the same name as the class in which it is present.
B. A constructor has a different name than the class in which it is present.
C. A constructor always returns an integer.
D. A constructor cannot be overloaded.

Option A
A constructor has the same name as the class in which it is present.

21. Copy constructor must receive its arguments by __________ .

A. either pass-by-value or pass-by-reference
B. only pass-by-value
C. only pass-by-reference
D. only pass by address

Option C
only pass-by-reference

22. When are the Global objects destroyed?

A. When the control comes out of the block in which they are being used.
B. When the program terminates.
C. When the control comes out of the function in which they are being used.
D. As soon as local objects die.

Option B
When the program terminates.

23. Which of the following statement is incorrect?

A. Constructor is a member function of the class.
B. The compiler always provides a zero argument constructor.
C. It is necessary that a constructor in a class should always be public.
D. Both B and C.

Option D
Both B and C.

24. Which of the following statement is correct?

A. Constructor has the same name as that of the class.
B. Destructor has the same name as that of the class with a tilde symbol at the beginning.
C. Both A and B.
D. Destructor has the same name as the first member function of the class.

Option C
Both A and B.

25. Which constructor function is designed to copy objects of the same class type?

A. Create constructor
B. Object constructor
C. Dynamic constructor
D. Copy constructor

Option D
Copy constructor

26. How many times a constructor is called in the life-time of an object?

A. Only once
B. Twice
C. Thrice
D. Depends on the way of creation of object

Option A
Only once

27. Which of the following statements are correct?

A. Constructor is always called explicitly.
B. Constructor is called either implicitly or explicitly, whereas destructor is always called implicitly.
C. Destructor is always called explicitly.
D. Constructor and destructor functions are not called at all as they are always inline.

Option B
Constructor is called either implicitly or explicitly, whereas destructor is always called implicitly.

28. Which of the following statement is correct?

A. A constructor of a derived class can access any public and protected member of the base class.
B. Constructor cannot be inherited but the derived class can call them.
C. A constructor of a derived class cannot access any public and protected member of the base class.
D. Both A and B.

Option D
Both A and B.

29. Destructors __________ for automatic objects if the program terminates with a call to function exit or function abort.

A. are called
B. are inherited
C. are not called
D. are created

Option C
are not called

30. A class's __________ is called when an object is destroyed.

A. constructor
B. destructor
C. assignment function
D. copy constructor

Option B
destructor

31. For automatic objects, constructors and destructors are called each time the objects

A. enter and leave scope
B. inherit parent class
C. are constructed
D. are destroyed

Option A
enter and leave scope

32. Destructor has the same name as the constructor and it is preceded by ______ .

A. !
B. ?
C. ~
D. $

Option C
( ~ )

33. Can a class have virtual destructor?

A. Yes
B. No

Option A
Yes

34. What happens when a class with parameterized constructors and having no default constructor is used in a program and we create an object that needs a zero-argument constructor?

A. Compile-time error.
B. Preprocessing error.
C. Runtime error.
D. Runtime exception.

Option A
Compile-time error.

35. A constructor that accepts __________ parameters is called the default constructor.

A. one
B. two
C. no
D. three

Option C
no



SHARE




FORUM
PRIVACY
TERMS & CONDITIONS
FEED BACK

Submit Your Feedback:


×

Thank You For Your Feedback!

Your message has been sent successfully.

Disclaimer
Interview Questions Answers .ORG is responsive and optimized web portal for individuals to get preparation for their job interviews, learning and training. Content at Interview Questions Answers .ORG might be simplified to improve our users experience. We constantly review our content to avoid errors and copyright violations, but we cannot warrant full correctness of all the content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2007-2025 by Interview Questions Answers .ORG All Rights Reserved.

Interview Questions Answers .ORG
Face Book Twitter Linkedin