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...

what is private constructor?what are the uses of writing
private constructor in our program?

Answer Posted / christian

a common use for a private constructor is to implement the
singletton pattern, which uses a public member variable of
the same type of the class which is defined. A public
getInstance() method uses this private constructor

Is This Answer Correct ?    13 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you write a conditional statement?

896


What are untrusted applets?

1071


Is arraylist dynamic in java?

930


Why is multiple inheritance not supported in java?

962


What is token in java?

960


What are access specifiers in java ?

1051


When to use runnable interface vs thread class in java?

930


Which list is sorted in java?

964


What is the difference between static (class) method and instance method?

1027


What is the declaration statement?

887


How many ways can you break a singleton class in java?

915


What is static in java?

1020


Explain constructors and types of constructors in java.

1038


Which category the java thread do fall in?

943


What package is math in java?

946