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
What is the purpose of polymorphism?
Why is encapsulation used?
Why do we use encapsulation in oops?
What language is oop?
What is balance factor?
What are oops functions?
Will I be able to get a picture in D drive to the c++ program? If so, help me out?
There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.
when to use 'mutable' keyword and when to use 'const cast' in c++
What is encapsulation in simple terms?
design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)
When not to use object oriented programming?
What is abstraction with example?
Whats oop mean?
What is the full form of oops?