Can we create object of class with private constructor?
Answer Posted / rahul dhangar
class Rahul
{
private:
int a,b,c;
Rahul()
{ cout<<"enter the no";
cin>>a>>b;
c=a+b;
cout<<c;
}
};
void main()
{
Rahul();
getch();
}
| Is This Answer Correct ? | 0 Yes | 4 No |
Post New Answer View All Answers
Why we use classes in oop?
What is abstract class in oops?
Why multiple inheritance is not allowed?
I have One image (means a group photo ) how to split the faces only from the image?............ please send the answer nagadurgaraju@gmail.com thanks in advace...
#include
What is a superclass in oop?
Where You Can Use Interface in your Project
What is the main purpose of inheritance law?
What is class and example?
Why is oop useful?
What makes a language oop?
What is polymorphism and why is it important?
Can enum be null?
Are polymorphisms mutations?
What are the 4 main oop principles?