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

Can we override compareto method?

987


How can you avoid serialization in child class if the base class is implementing the serializable interface?

1125


How do I stop concurrentmodificationexception?

1079


What are java annotations?

1225


What is lossy conversion in java?

1277


Differentiate between a constructor and a method? Can we mark constructors final?

1244


What will happen when using pass by reference in java?

1039


What does g mean in regex?

1031


What is difference between ++ I and I ++ in java?

1030


What are annotations in java?

1139


Difference between linkedlist and arraylist.

1116


Difference between static synchronization vs. Instance synchronization?

1172


List some important characteristics on jre

1132


What is the difference between length and length () in java?

992


What are implicit objects in java?

1024