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 is the purpose of a volatile variable?

977


What is a method type?

943


give an example for encapsulation?

988


What are constants?

999


How do you square a number in java?

1003


how to create daemon thread in java?

1013


Give differences between Quicksort & Mergesort. When should these sorts be used and what is their running time?

1003


How to change value in arraylist java?

1099


What is the this keyword?

979


What is the difference between && and & in java?

1026


What methods are used in Servlet?Applet communication?

2175


Why we do exception handling in java and how many types of exceptions are there?

1048


What is concurrent hashmap and its features?

1022


What is the functionality of the stub?

971


What is static method with example?

1096