[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.
Technical Discussion :: C++

4 / 187

What are characteristics of the constructor function?

Answer:

The constructor functions have some characteristics:

• They should be declared in the public section.
• They got invoked automatically when the objects are created.
• They do not have return types, not even void and therefore, they cannot return values.
• They cannot be inherited, through a derived class can call the base class constructor.
• Like other c++ functions, they can have default arguments.
• Constructors cannot be virtual.
• We cannot refer to their addresses.
• An object with a constructor cannot be used as a member of a union.
• They make implicit calls to the operators new and delete when memory allocation is required.

When a constructor is declared for a class, initialization of the class objects becomes mandatory.

Asked In ::

Post Your Answer Here:


Rate This: +0 -0     
Report    

Post Your Reply Here:

Alert me
q4i-reply-your-answer

Report Error

Please Login First Click Here

Most Popular Qs.