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 field name?
Will set allow duplicates in java?
What do you mean by byte code?
Can we change the scope of the overridden method in the subclass?
Difference between doublesummarystatistics, intsummarystatistics and longsummarystatistics ?
what do you mean by classloader in java?
What is Java Annotations?
what is encapsulation in java? Explain
What is externalizable interface?
Why we go for collections in java?
Can private class be extended java?
If a variable is declared as private, where may the variable be accessed?
Java is pass by value or pass by reference? Explain
What is java Applet?
Explain about transient variables in java?