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 declaring constructor as private?

Answer Posted / ranganathkini

By declaring the class constructor as private, other classes
cannot create instances of the class.

This design is usually used in singleton patterns.

Is This Answer Correct ?    22 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are recursive functions?

1055


What is JVM and is it platform independent?

1045


State differences between C and Java?

1202


What is the purpose of static keyword in java?

961


Explain the polymorphism principle?

1006


Can singleton class be inherited in java?

995


What is a return in java?

1026


Can a class be final?

936


What do the thread?class methods run() and start() do?

1032


Can we use a switch statement with strings?

1049


What is mean by encoding?

1076


How do you clear an arraylist in java?

985


Can a class have an interface?

981


What is the tradeoff between using an unordered array versus an ordered array?

1229


How many types of array are there?

1005