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

What are the benefits of immutable objects?

986


What is difference between classpath and path variables in java?

1178


What does file separator do in java?

1000


Explain when we should make an instance variable private.

1098


What is variable explain with example?

1037


Can you pass functions in java?

980


What does java ide mean?

1111


What is int argc char * argv?

1130


What are different types of inner classes ?

1028


What is the final access modifier in java?

1063


What causes memory leaks in java?

914


What is the difference between a checked and an unchecked exception?

979


Explain the difference between an object-oriented programming language and object-based programming language?

969


How to invoke external process in java.

1062


Can we catch more than one exception in a single catch block?

1059