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?

Answers were Sorted based on User's Feedback



How can we design/implement singleton object?..

Answer / 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

How can we design/implement singleton object?..

Answer / todd d. roling

public enum Singleton {
INSTANCE;
}

Is This Answer Correct ?    2 Yes 1 No

How can we design/implement singleton object?..

Answer / jayashri

by declaring the constructor as private and we have to create public static method which returns the address of single object.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Design Patterns Interview Questions

i have file(ps),dont know how many records are there. move half of the records to 2 files. how can we do

1 Answers   IBM, Infosys,


What are the SDLC phases you have invloved ?

0 Answers   Infosys, Tech Mahindra,


What are the design patterns and How can they make life easier for software development ?

1 Answers   ABC, HP,


What is aop design?

0 Answers  


What three types of components comprise an application design?

1 Answers  


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

0 Answers  


What are sequence diagrams, collaboration diagrams and difference between them ?

8 Answers   ACET, CT, CTS, Infosys,


What is the executor design pattern?

0 Answers  


Suppose we have file(ps), dont know how many records are there. Move half of the records to 2 files. How can we do?

0 Answers  


What are useful tools for developing and testing color schemes for web sites?

0 Answers   Wipro,


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?

0 Answers  


Can we use an equated value as operands for an MVC ? Reason for the same.

0 Answers   Ness Technologies,


Categories