Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: James Rivera   on Jul 31 In Java Category.

  
Question Answered By: Eloise Lawrence   on Jul 31

Constructor are declared private  only when u want to prevent any other
class to create an instance of that object. This is generally required
when u want to implement Singleton design pattern and ensure that only
one instance exists for a particular object in the JVM

Share: 

 

This Question has 28 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Why we declare the constructor private? Or get search suggestion and latest updates.


Tagged: