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?

Answers were Sorted based on User's Feedback



what is the use of private constructor in core java?..

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

what is the use of private constructor in core java?..

Answer / rajib

Whenever we r using singleton class then we use constructor
as private.

Is This Answer Correct ?    38 Yes 6 No

what is the use of private constructor in core java?..

Answer / deep chandra harbola

private constructor are used to create Sinleton class.
example logger class
for singleton class only one object can be created.
by default member of singleton class are static.
singleton class can not be inherited.

Is This Answer Correct ?    29 Yes 3 No

Post New Answer

More Core Java Interview Questions

What is "Java Native Interface" and how to use it?

1 Answers   IBM,


When is the finalize() called? What is the purpose of finalization?

0 Answers  


how you will prevent inheritance is there any other way other than inheritance?

4 Answers   Wipro,


How java is similar to c?

0 Answers  


How a class can implement an interface?

5 Answers   SysArc,


Should a main method be compulsorily declared in all java classes?

0 Answers  


What is the difference between a factory and abstract factory pattern?

0 Answers  


Explain the meaning of java applet.

0 Answers   TCS,


Can we have static methods in an interface?

0 Answers  


Why is multithreading important?

0 Answers  


Are true and false keywords?

0 Answers  


hoe can u call a constructor of a private classs to other inherited claa??

1 Answers  


Categories