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
What is included in core java?
Is char * a string?
How many characters is 2 bytes?
Describe method overriding
What is the difference between an object-oriented programming language and object-based programming language?
Explain about anonymous inner classes in java?
What is flag in java?
How do you use parseint in java?
I want to persist data of objects for later use. What is the best approach to do so?
How to retrieve data from database in java using arraylist?
What are identifiers in java?
enlist some features of jdk.
How can we create an immutable class in java?
What is use of valueof () in java?
What is length in java?