how to handle a singleton service locator. when multiple threads
are trying to get the singleton object in same time

Answer Posted / sitaram

Singleton service means only one service provide at a
time.When multiple threads are trying to get the singleton
object in the same time.we can get an error. because only
one object provide in complete application.

Is This Answer Correct ?    17 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can an exception be thrown manually by a programmer?

726


What is the effect of keeping a constructor private?

679


What is the use of singleton class?

719


What are the approaches that you will follow for making a program very efficient?

833


Are static members inherited to sub classes?

877


What is the purpose of garbage collection in java?

840


How does compareto method work?

722


Explain the transient field modifier?

774


Difference between arraylist and hashset in java?

774


What are the different types of inheritance in java?

757


Can you extend main method in java?

838


I want to re-reach and use an object once it has been garbage collected. Define how it’s possible?

798


Are private methods final?

659


What is the use of volatile in java?

806


What is the difference between error and an exception?

770