Advertisement Remove all ads

State Any 6 Characteristics of Constructor. - Computer Science 1

Advertisement Remove all ads
Advertisement Remove all ads
Advertisement Remove all ads

State any 6 characteristics of Constructor.

Advertisement Remove all ads

Solution

(1) The constructor name is always same as the class name.
(2) They do not have return types, not even void and therefore, they cannot return values.
(3) They cannot be static or virtual.
(4) They should be declared in public section.
(5) They cannot be inherited though a derived class can call base class constructor.
(6) Like other C++ functions, they can have default arguments.
(7) We cannot refer to their address.
(8) An object with a constructor cannot be used as a member of union.
(9) They make implicit calls to the operators ‘new’ and ‘delete’ when memory allocation is required.
(10) When a constructor is declared for a class, initialization of class objects become mandatory, since constructor is invoked automatically when the objects are created.

Concept: C++ Programming
  Is there an error in this question or solution?

APPEARS IN

Advertisement Remove all ads
Share
Notifications

View all notifications


      Forgot password?
View in app×