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 / nandhakumar

We use private constructor in singleton class:it ve only one
instance,in this case we generally used to ve one static
method (getInstance()).While we cal this method first time
it use private constructor to create instance.next time this
method returns the existin instance..

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does .length start 0 java?

1062


What is the structure of java?

1076


Difference between ‘is-a’ and ‘has-a’ relationship in java?

1043


Define max and min heap, also the search time of heap.

1075


What happens if we don’t define serial version uid?

1079


What is memory leak and how does java handle it?

1030


Is nan false?

1048


What are java packages?

1087


What is float in java?

1036


When is finally block not called?

1144


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

1031


What exceptions occur during serialization?

1146


Is age discrete or continuous?

1190


What is jdbc api?

1060


What do heavy weight components mean in java programming?

997