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
How to check if linked list contains loop in java?
What is difference between next () and nextline () in java?
What do you meant by active and passive objects?
Why volatile is used in java?
Can we clone singleton object in java?
How do you represent a space in regex java?
What are the advantages and disadvantages of reference counting in garbage collection?
What is the purpose of garbage collection in java? When is it used?
Is java jre still free?
What does those terms actually mean included in the j.d.k i.6?
What is an array in java?
How to reverse a string in java?
How we can make copy of a java object?
What is void data type?
How to add menushortcut to menu item?