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 good declaration?

988


What do you mean by light weight and heavy weight components?

1019


What’s the difference between unit, integration and functional testing?

1111


what is the difference between the methods sleep() and wait()? : Java thread

976


What do you mean by ordered and sorted in collections in java?

997


How is abstraction implemented in java ?

1021


What is the final field modifier?

976


What is a method in java?

1055


What is the use of flag?

1092


Why java is object oriented?

1040


Can an object subclass another object?

1119


What is a buffer in java?

1036


How does indexof work?

967


Why are parameters used in functions?

1020


What is the advantage of OOP in java?

1151