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 does it mean when someone says I oop?

1063


INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?

2209


What is the real time example of encapsulation?

1070


Is abstract thinking intelligence?

1053


What is the benefit of oop?

1058


What is the difference between encapsulation and polymorphism?

1112


What is the example of polymorphism?

1132


What does oop mean in snapchat?

1236


What are the features of oop?

1179


What is the real time example of inheritance?

1153


Whats is abstraction in oops?

1079


Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.

2464


What is pure oop?

1105


What is a class and object?

1055


When not to use object oriented programming?

1110