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 private constructor?what are the uses of writing
private constructor in our program?

Answer Posted / nandhakumar

We use private constructor in singleton class:it ve only one
instance,in this case we generally used to ve one static
method (getInstance()).While we cal this method first time
it use private constructor to create instance.next time this
method returns the existin instance..

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can list have duplicates in java?

907


Write a program to find the greatest of three numbers in java?

1003


What is array size in java?

958


What is the final class?

1058


What are "methods" and "fields"?

1018


What is the default size of load factor in hashing based collection?

1049


How can we make a class virtual?

1113


What is string :: npos?

1086


Does A Class Inherit The Constructors Of Its Superclass?

1074


What is set string?

1183


What is the symbol for line break?

1097


What are the rules for naming an array?

1060


How do you add spaces in java?

1008


Can a class declared as private be accessed outside it’s package?

1013


Is there any limitation of using inheritance?

1089