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.
Siva said:
9 years ago
What are the keys using inheritance?
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.
Farid said:
9 years ago
What is constructor explain with example?
Prashant said:
9 years ago
The friend is not a constructor because friend is an access specifier and they used in asp.net.
Logi said:
9 years ago
Friend is a function.
Akhilesh kesarwani said:
9 years ago
The friend is not a constructor because it is a function.
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.
Afsha said:
9 years ago
Friend is a function not constructor.
Akash Dhule said:
9 years ago
Remaining options are types of constructor and friendly is a function.
Sakshi jain said:
9 years ago
Default, Parameterized, and Copy constructor are the constructor types of C++.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers