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 6 of 7.

Afsha said:   9 years ago
Friend is a function not constructor.

Nitika Singh said:   9 years ago
We can pass the value as a parameter of the constructor, but it's not a type of constructor.

Akhilesh kesarwani said:   9 years ago
The friend is not a constructor because it is a function.

Logi said:   9 years ago
Friend is a function.

Prashant said:   9 years ago
The friend is not a constructor because friend is an access specifier and they used in asp.net.

Farid said:   9 years ago
What is constructor explain with example?

Chetna Borse said:   9 years ago
Constructor is used to initialize the objects and the name of the constructor is same as the name of the class. And we can say construct the values of data members.

for eg. class demo
{
int a;
demo()
{
a=0
}
};

In this example, demo is the class and the name with parentheses is the constructor.
Whenever we create the object of the class demo the constructor will be called and assign value 0 to variable a.

Siva said:   9 years ago
What are the keys using inheritance?

Sneha Tiwari said:   8 years ago
Constructors, as we know have the same name as the class name. They can be three types of constructors namely:
1) Default constructor e.d constr() which has no parameters.
2) Parameterised constructors constr(x,y) that have some parameters passed to it.
3) Copy constructor constr(&object of constructor) that take input as the object of constructor type or rather copies the value of the constructor.

Friend functions exist but friend constructor don't exist in object oriented concept.
(1)

Anita said:   8 years ago
Friend constructor is not a type of constructor.


Post your comments here:

Your comments will be displayed after verification.