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
IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?
i=20;k=0;
for(j=1;k-i;k+=j<10?4:3)
{
cout< How oops is better than procedural? What is the diamond problem in inheritance? What is balance factor? What is encapsulation in oops? Explain the advantages of inheritance. Why do we need polymorphism in c#? How do you define a class in oop? How do you explain polymorphism? Why do we use oops? What is cohesion in oop? can we make game by using c
Why do we use polymorphism in oops? What is solid in oops?