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...

How can we design/implement singleton object?

Answer Posted / ravi

Make the constructor private

provide a static synchronized method to get the Instance.

this should make the object singleton for that jvm instance

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the benefits of the proxy in the design pattern?

1062


Which design patterns have you used in your project ?

1044


Hi, I have 9backlogs in btech and i am 2008 passed out,am working with an MNC from past 3 years.now, am willing to do MS, will it be any problem for me?

3136


What is the gang of four design pattern?

1094


What is the builder pattern?

1091


Why should we not use singleton pattern?

1100


What is the factory pattern in the design pattern?

1174


What is use case in clean architecture?

1111


Did you use ooa/ood methodologies? Did you use design patterns?

1108


Is mvc is a design pattern?

1106


What is the difference between architecture and design?

1102


Is singleton a design pattern?

1016


What are the most important software design patterns?

1180


What are the differences between the design patterns and the framework?

1192


What is the concurrency design pattern?

1160