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 happens if an exception is throws from an object's destructor?

0 Answers   Amazon,


Which is the best way of exception handling?

2 Answers   Oracle,


What are advantages of using Java?s layout managers than windowing systems?

0 Answers  


What is a void method java?

0 Answers  


What are different types of arrays?

0 Answers  


What is the difference between comparison done by equals method and == operator?

0 Answers  


How to write custom exception in java?

0 Answers   Cyient,


What are different access specifiers in java? Explain

0 Answers  


What is string immutability?

0 Answers  


What does @param args mean in java?

0 Answers  


What do you understand by private, protected and public?

0 Answers  


How do you clear a method in java?

0 Answers  


Categories