arrow
arrow
arrow
Which of the following are TRUE about constructors in C++? A. A constructor can be overloaded. B. A constructor does not have a return type.
Question



Which of the following are TRUE about constructors in C++?
A. A constructor can be overloaded.
B. A constructor does not have a return type.
C. A constructor must be declared as a friend function.
D. A constructor is called when an object is destroyed.
Choose the correct answer from the options given below:

A.

B, C, D only

B.

B, C only

C.

A, B, C only

D.

A, B only

Correct option is D

In C++, constructors have special properties that define how objects are initialized. Constructors do not have return types, and they can be overloaded to allow different ways of object creation.
1. A constructor can be overloaded.
· This is true. Overloading allows defining multiple constructors with different parameters, which can be helpful in providing various ways to initialize an object.
2. A constructor does not have a return type.
· This is true. Unlike other functions, constructors do not have a return type, not even void.
Information Booster
· Constructors cannot be friend functions because they are part of the class and designed to initialize the object.
· Constructors are called only during object creation. When an object is destroyed, destructors (not constructors) are called.

Free Tests

Free
Must Attempt

UGC NET Paper 1 Held on 25 June 2025 Shift 1

languageIcon English
  • pdpQsnIcon50 Questions
  • pdpsheetsIcon100 Marks
  • timerIcon60 Mins
languageIcon English
Free
Must Attempt

Elizabethan Drama

languageIcon English
  • pdpQsnIcon10 Questions
  • pdpsheetsIcon20 Marks
  • timerIcon12 Mins
languageIcon English
Free
Must Attempt

India’S Foreign Trade Policy Balance Of Payments (Bop)

languageIcon English
  • pdpQsnIcon10 Questions
  • pdpsheetsIcon20 Marks
  • timerIcon12 Mins
languageIcon English
test-prime-package

Access ‘UGC NET Computer Science’ Mock Tests with

  • 60000+ Mocks and Previous Year Papers
  • Unlimited Re-Attempts
  • Personalised Report Card
  • 500% Refund on Final Selection
  • Largest Community
students-icon
239k+ students have already unlocked exclusive benefits with Test Prime!
Our Plans
Monthsup-arrow