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

Answer Posted / krishnapal

Using synchronized method we can using put requesting
threads into waiting queue.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can we access some class in another class in java?

555


Tell us something about different types of casting?

523


What is qms certification?

524


What are filterstreams?

617


What is arguments in java?

525






Can we declare the main method of our class as private?

557


What is nullpointerexception?

560


Why we do exception handling in java and how many types of exceptions are there?

551


What is predicate in java?

562


What do you understand by casting in java language?

580


Why string is immutable with example?

532


What are the types of methods in java?

582


Is string is a class in java?

527


What is regex used for?

550


Can an interface extend a class?

542