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 the use of private constructor in core java?

Answer Posted / rakesh

Private constructor can be used if we do not want any other
class to instantiate the class. This concept is generally
used in Singleton Design Pattern. The instantiation of such
classes is done from a static public method.

Is This Answer Correct ?    54 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I want my class to be developed in such a way that no other class (even derived class) can create its objects. Define how can I do so?

1121


Can we call virtual funciton in a constructor ?

2137


Mention the default values of all the elements of an array defined as an instance variable.

924


Which is a valid identifier?

1103


What is a cup of java?

981


Can we have more than one package statement in source file ?

964


What is byte code and why is it important to java’s use for internet programming?

1051


What class allows you to read objects directly from a stream?

1287


Can you inherit a constructor java?

1021


What is lexicographically smallest string?

1018


What is a conditional statement explain with example?

964


how to create constants in java?

1039


What is final int?

950


What is java thread dump, how can we get java thread dump of a program?

942


What do you understand by the bean persistent property?

950