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 many arguments can a method have java?

1069


Why can't you declare a class as protected?

1207


What is pangram in java?

1077


What is the original name of java?

1170


Is array dynamic in java?

991


What does math floor () do?

1008


How many types of equations are there?

1066


What state does a thread enter when it terminates its processing in java programming?

1089


What super () does in java?

966


How can we use primitive data types as objects?

1002


What is serialversionuid?

1157


What does pointer mean?

1127


When can an object reference be cast to an interface reference in java programming?

1068


Why doesn't the java library use a randomized version of quicksort?

1034


How many threads can I run java?

1177