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 you have two constructors in java?
What is slash r?
What is string args [] in java?
Mention some interfaces implemented by linked list in java.
Is cout buffered?
How can you avoid serialization in child class if the base class is implementing the serializable interface?
When a lot of changes are required in data, which one should be a preference to be used? String or stringbuffer?
What is meant by class loader? How many types are there? When will we use them?
Give a practical example of singleton class usage?
What is the basic concepts of OOPS?
Write a program to print all permutations of string?
What's the access scope of protected access specifier?
What does pointer mean?
What are annotations in java?
How do you test a method for an exception using junit?