how to handle a singleton service locator. when multiple threads
are trying to get the singleton object in same time
Answers were Sorted based on User's Feedback
Answer / krishnapal
Using synchronized method we can using put requesting
threads into waiting queue.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / wikipedia
Detailed answer here:
http://en.wikipedia.org/wiki/Singleton_pattern
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / gowramma m
Two ways to create threads
1)by creating thread class
class classname extends Thread
{
}
2)By converting class to thread ie using Runnable interface
| Is This Answer Correct ? | 1 Yes | 7 No |
What is the implementation of destroy method in java. Is it native or java code?
Explain the concept of proper inheritance?
0 Answers Thomson Reuters, Virtusa,
wat is final...? wat is finally...? wat is finalize....? difference between " final and finally and finalize "...?
explain what is transient variable in java?
________ exception must be either caught or specified in throws class of the method.
Why local variables are stored in stack?
How do you do exponents in java?
What do you mean by singleton class in java?
What is mvc in java?
What is mutable object and immutable object?
Why Java is not pure Object Oriented language?
What state is a thread in when it is executing?