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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is java abstraction with example?

561


Which is better list or arraylist in java?

497


How can we create a thread in java?

589


Why is the singleton pattern considered to be an anti pattern?

480


What is lambda in java?

522






why Interface used?

540


Who developed java?

574


What is private static in java?

581


What is the hashcode () and equals () used for?

538


What does void * mean?

537


What are the major drawbacks of external iteration?

578


when to use ArrayList and when to use HashMap in webApplication.

3892


What is the use of string and stringbuffer?

556


Explain the advantages of packages in java?

517


What is OOP's Terms with explanation?

611