C++ Programming - OOPS Concepts - Discussion

Discussion Forum : OOPS Concepts - General Questions (Q.No. 28)
28.
Which of the following functions are performed by a constructor?
Construct a new class
Construct a new object
Construct a new function
Initialize objects
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
12 comments Page 2 of 2.

Adeq said:   6 years ago
A constructor is a member function of a class that initializes objects of a class. In C++, Constructor is automatically called when an object(instance of class) is created.

So this is the first function that is automatically called after the creation of object.

Kanak Agrawal said:   4 years ago
The constructor is used to initialize an object.
And a object is created using "new".
So, option D is correct.


Post your comments here:

Your comments will be displayed after verification.