C++ Programming - OOPS Concepts - Discussion

Discussion Forum : OOPS Concepts - General Questions (Q.No. 2)
2.
Which of the following is not a type of constructor?
Copy constructor
Friend constructor
Default constructor
Parameterized constructor
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
68 comments Page 3 of 7.

Satya said:   10 years ago
The default object is constructor.

Raman said:   10 years ago
The dynamic constructor is not in this? Why?

Jitendra Kumar said:   10 years ago
C++ have only three type of constructor:

1. Copy constructor.

2. Default constructor.

3. Parameter constructor.

Thazaar said:   10 years ago
Constructors are used to initialize the object whereas friend function is used to access the private data member of the classes.

Neelam said:   1 decade ago
Any other constructors?

Neelam said:   1 decade ago
Total three types of constructor is there.

Yogesh rajput said:   1 decade ago
Only three type of constructor are, friend is a special member function, so it is a right answer.

Rajput yogesh said:   1 decade ago
1. Constructor.

2. Copy constructor.

3. Default constructor.

4. Parameterized constructor, only three type of constructor also friend is a special member function are there.

Shudhanshu shekhar said:   1 decade ago
There are three types of constructors:

1. Default constructor -->no parameter.

2. Parameterised constructor-->having parameters like arguments of a function.object is declared with blues for that arguments.

3. Copy constructor-->invoked when an object is copied to another object.

classname ob1;
ob2=ob1; /*copy constructor called*/

When an object is passed by value to a function then also copy constructor is invoked.

Note--> Array of objects can never be created without default constructor. If two default constructors are there i mean first having no argument and second having default argument then error will generated while creating array of objects.

So it is desirable to declare only one default constructor while creating array of objects.

Maddirala said:   1 decade ago
Friend constructors are not possible because this is the function not a class which is used for accessing private data and member variables outside class.


Post your comments here:

Your comments will be displayed after verification.