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 have a private constructor ?

Answer Posted / srikanth

We can make a constructor Private or protected.
1. Private constructor is classic example of implementing a
singleton class( A class with a single instance)
2. Protected constructors can be used when the class cannot
be instantiated but can only be inherited.

Is This Answer Correct ?    108 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the real life example of polymorphism?

1111


What is difference between inheritance and polymorphism?

976


Explain the advantages of inheritance.

1076


What is encapsulation and abstraction? How are they implemented in C++?

1066


What is overloading in oops?

1091


Can static class have constructor?

984


How can you overcome the diamond problem in inheritance?

1138


What is difference between pop and oop?

1076


What is polymorphism explain?

1191


Can a destructor be called directly?

1019


What is static in oop?

1025


What does sksksk mean in text slang?

2053


What is coupling in oop?

968


Why do we use polymorphism?

1009


Why is encapsulation used?

947