Can we have this pattern implemented using static class?



Can we have this pattern implemented using static class?..

Answer / Sanjay Sharma

Yes, Singleton can be implemented using a static class in Java. However, it's not recommended because static methods are thread-safe by default and don't provide the ability to lazily initialize or perform double-checked locking.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Design Patterns Interview Questions

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

1 Answers   Wipro,


What are the categories in which the design patterns can be divided?

1 Answers  


4. Identify and bound the SOI’s Operating Environment.

1 Answers  


What is the difference between proxy and adapter?

1 Answers  


. How can a product be accessible to differently-abled people?

3 Answers  


What is the singleton design pattern?

1 Answers  


What is the publish/subscribe model?

1 Answers  


What are structural design patterns?

1 Answers  


How can we design/implement singleton object?

3 Answers   HP,


write 5 best test cases like any password?password should be mixed case with atlest one number or special characters?

2 Answers   Wipro,


What is design pattern ?

4 Answers   Accenture,


In what cases are synchronous architectures more appropriate than asynchronous architectures?

1 Answers   Wipro,


Categories