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?
Discussion:
68 comments Page 2 of 7.
Vigneshwar said:
1 decade ago
Friend is not a constructor its a function...
Remaining all option to be under the constructor type...
Constructor is used to invoke the object..
Remaining all option to be under the constructor type...
Constructor is used to invoke the object..
Pooja Naokar said:
1 decade ago
There are 3 types of constructors
1. Default constructor with no parameters.
2. Parameterized constructor as its name implies with
one or more parameters.
3. Copy constructor which takes reference of object as
parameter.
And Friend is a funcion to access private members of 2 different classes to which it has been declaredas friend.
1. Default constructor with no parameters.
2. Parameterized constructor as its name implies with
one or more parameters.
3. Copy constructor which takes reference of object as
parameter.
And Friend is a funcion to access private members of 2 different classes to which it has been declaredas friend.
Sujit kumar said:
1 decade ago
Friend is not a constructor its a function.
Remaining all option to be under the constructor type.
Constructor is used to invoke the object.
Remaining all option to be under the constructor type.
Constructor is used to invoke the object.
Manu said:
1 decade ago
Because friend function is used not constructor.
Pradeep said:
1 decade ago
Friend Keyword is used for class and Functions. Rest of the 3 options are available constructor in c++.
Sahithi said:
1 decade ago
Friend is a function but it is not a constructor.
Sushil Sinha said:
1 decade ago
Friend is not a constructor. It is just a function. All options except friend are types of constructor.
Kapil jat said:
1 decade ago
Friend is only function not a create constructor.
Sumesh sg said:
1 decade ago
Because friend is a non member function.
It is a function and not a constructor.
Since there are 3 types of constructor i.e.
1. Parameterized constructor.
2. Default constructor.
3. Copy constructor.
It is a function and not a constructor.
Since there are 3 types of constructor i.e.
1. Parameterized constructor.
2. Default constructor.
3. Copy constructor.
Varun Vivek J said:
1 decade ago
Friend is a function.
Where as all others are constructors.
Its a pre defined function and can be used to create functions whereas, constructors are used for functions itself!
Where as all others are constructors.
Its a pre defined function and can be used to create functions whereas, constructors are used for functions itself!
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers