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
write knight tour problem which is present in datastructure
What is abstraction oop?
Can private class be inherited?
Can you inherit a private class?
Is oop better than procedural?
What is destructor give example?
What is difference between abstraction and encapsulation?
What are oops methods?
What is polymorphism oop?
What are the three main types of variables?
What is the real life example of polymorphism?
What is the real time example of encapsulation?
what's the basic's in dot net
• What are the desirable attributes for memory managment?
When not to use object oriented programming?