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 3 of 7.
Sakshi jain said:
9 years ago
Default, Parameterized, and Copy constructor are the constructor types of C++.
Akash Dhule said:
9 years ago
Remaining options are types of constructor and friendly is a function.
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.
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?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers