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 do we use polymorphism in oops?
How do you define social class?
What is polymorphism oop?
What is the difference between abstraction and polymorphism?
Why is polymorphism important in oop?
How Do you Code Composition and Aggregation in C++ ?
given a set based questions and 5 questions based on it next data sufficiciency questions 2 and 2/3 english sentence completion with options very easy and 2 synononmys paragraph with 10 questions 10 minutes replace =,-,*,% with -,%,+,* type questions 5 3 questions lik following itssickhere itssickthere itssickhere istsickhere which is nt alike the others very easy
Write a c++ program to display pass and fail for three student using static member function
program for insertion ,deletion,sorting in double link list
What is polymorphism what is it for and how is it used?
What is the example of polymorphism?
How does polymorphism work?
What is oops in simple words?
What is encapsulation example?
What is destructor example?