Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is the purpose of polymorphism?

1099


Why is encapsulation used?

961


Why do we use encapsulation in oops?

999


What language is oop?

990


What is balance factor?

1030


What are oops functions?

983


Will I be able to get a picture in D drive to the c++ program? If so, help me out?

2166


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.

1949


when to use 'mutable' keyword and when to use 'const cast' in c++

2124


What is encapsulation in simple terms?

1000


design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)

6645


When not to use object oriented programming?

1046


What is abstraction with example?

1069


Whats oop mean?

1001


What is the full form of oops?

1142