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
Why put method is idempotent?
If try block is successfully executed, Then Is Finally block executed?
What is the difference between Java and C++?
Is node a data type in java?
how does multithreading take place on a computer with a single cpu? : Java thread
What is JVM and is it platform independent?
Can a method be overloaded based on different return type but same argument type?
What is object-oriented paradigm?
Why is java multithreaded?
What is consumer in java?
Give some features of interface?
What is entry in java?
What’s meant by anonymous class?
Difference difference paint() and paintcomponent()?
What is the arraylist in java?