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

Is mvc a software design pattern?

1149


What is synchronizer token pattern?

1102


What are the disadvantages of singleton pattern?

1138


what is the lazy design pattern?

1053


Which design patterns have you used in your project ?

1044


What is use case in clean architecture?

1109


What is factory method in design pattern?

1049


What are the design patterns you know explain?

1113


What is the behavioral design pattern?

1142


Is singleton bean thread safe?

954


Describe the builder design pattern

1130


What is single tone design pattern in java?

1062


Can we make the reference instance non static?

1085


Shall we use abstract classes or interfaces in policy / strategy design pattern?

1104


What is the prototype design pattern?

1085