IndiaBIX
IndiaBIX
Start typing & press "Enter" or "ESC" to close
  • Home
  • Jobs
  • Results
  • Current Affairs
  • GK
  • Online Test
  • HR Interview
  • BLOG

Constructors and Destructors

  • Home
  • Computer Science & Engineering
  • C++ Programming Questions and Answers
  • Constructors and Destructors
1. 

Which of the following statement is correct whenever an object goes out of scope?

A. The default constructor of the object is called.
B. The parameterized destructor is called.
C. The default destructor of the object is called.
D. None of the above.

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

2. 

Which of the following statement is correct about constructors?

A. A constructor has a return type.
B. A constructor cannot contain a function call.
C. A constructor has no return type.
D. A constructor has a void return type.

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

3. 

To ensure that every object in the array receives a destructor call, always delete memory allocated as an array with operator __________ .

A. destructor
B. delete
C. delete[]
D. kill[]
E. free[]

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

4. 

Which of the following gets called when an object is being created?

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

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

5. 

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

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

6. 

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.

Answer: Option B

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

7. 

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.

Answer: Option D

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

8. 

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

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

  • 1
  • 2
  • 3
  • 4
  • 5

Questions & Answers

Aptitude Chemical Engineering Civil Engineering Computer Science & Engineering Current Affairs Data Interpretation Electrical & Electronics Engineering Electronics & Communication Engineering General Knowledge Logical Reasoning Mechanical Engineering Non Verbal Reasoning Verbal Ability Verbal Reasoning

Interviews

HR Interview

Jobs

Sarkari Jobs

Results

Rojgar ResultSarkari Result

Admission

Admission 2023

Admit Card

Admit Card 2023

Answer Key

Answer Key 2023
copyright
Privacy Policy
© 2025 IndiaBIX. All Rights Reserved.

Report