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
Can we override compareto method?
How can you avoid serialization in child class if the base class is implementing the serializable interface?
How do I stop concurrentmodificationexception?
What are java annotations?
What is lossy conversion in java?
Differentiate between a constructor and a method? Can we mark constructors final?
What will happen when using pass by reference in java?
What does g mean in regex?
What is difference between ++ I and I ++ in java?
What are annotations in java?
Difference between linkedlist and arraylist.
Difference between static synchronization vs. Instance synchronization?
List some important characteristics on jre
What is the difference between length and length () in java?
What are implicit objects in java?