Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to make a method thread safe without using synchronized
keyword?

Answer Posted / dandhar

Make the "inUse" variable to static.

private static boolean inUse = false;

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why put method is idempotent?

838


If try block is successfully executed, Then Is Finally block executed?

1037


What is the difference between Java and C++?

1124


Is node a data type in java?

942


how does multithreading take place on a computer with a single cpu? : Java thread

1081


What is JVM and is it platform independent?

987


Can a method be overloaded based on different return type but same argument type?

907


What is object-oriented paradigm?

1006


Why is java multithreaded?

932


What is consumer in java?

919


Give some features of interface?

1017


What is entry in java?

968


What’s meant by anonymous class?

1019


Difference difference paint() and paintcomponent()?

943


What is the arraylist in java?

980