C++ Programming - OOPS Concepts - Discussion

Discussion Forum : OOPS Concepts - General Questions (Q.No. 17)
17.
Which of the following statement is correct?
A constructor is called at the time of declaration of an object.
A constructor is called at the time of use of an object.
A constructor is called at the time of declaration of a class.
A constructor is called at the time of use of a class.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
26 comments Page 1 of 3.

Priyanka p said:   1 decade ago
According to me, constructor is a special function which can be invoke when object is created.

Biraj said:   1 decade ago
Option A and D are same and both are wrong.
Constructor is called at time of object creation :-)

Sri said:   1 decade ago
When we are declare or creating the objects then the constructor is automatically invoked.

Shadab said:   1 decade ago
According to me, When we are create a object then automatically create default Constructor.

Simran said:   1 decade ago
Constructor is automatically called when we create the object.

Baru said:   1 decade ago
Constructor having same class name that's why we are call the constructor at the time of object creation.

Object creation is:.

Classname refernce variable=new classname () ;.

In this constructor name n classname is also same that's why we are call the constructor at the time of object creation.

Pradeep said:   1 decade ago
Because an constructor is called right when the object is created for a class.

Farhana said:   1 decade ago
Constructor is a special member function of a class which is called/invoked when the object is created. It has the same name as that of a class.

Ashish Bardiya said:   1 decade ago
Constructor is call when an object is created or initialize. When we not write a code for constructor then compiler automatically added default constructor.

Narmadhasrinivasan said:   1 decade ago
Can you tell me whats the use of constructor?


Post your comments here:

Your comments will be displayed after verification.