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

Can we convert list to set in java?

921


Is there is any difference between a scrollbar and a scrollpane?

939


What are namespaces in java?

974


What do you mean by of string::valueof expression in java 8?

903


How do listeners work?

982


What are the advantages of java?

929


Can we create an object if a class doesn't have any constructor ( not even the default provided by constructor ) ?

1024


What are the Static and Dynamic Variables? Differentiate them.

1044


How to find the largest value from the given array.

964


How do you invoke a method?

950


Explain notifyall() method of object class ?

1044


What is class forname used for?

997


Can we pass a primitive type by reference in java? How

855


What is the preferred size of a component in java programming?

955


What is difference in between java class and bean?

1028