How the threads are synchronized?
Answers were Sorted based on User's Feedback
Answer / seshadri pera
Threads are synchronized in two ways.
1) block level
2) Method level
Block level synhronization is the better performance
compare to method level.
Block Level:
see the code syntax for block level
synchronized {..
....//code to lock the specific object here..
...}
Method Level:
See the syntax
public void synchronized XXXMethodName(Parameters or
object to acquire locking){.....
...}
| Is This Answer Correct ? | 7 Yes | 1 No |
Answer / dsr
By using wait(),notify and notifyall() methods in the code.
| Is This Answer Correct ? | 2 Yes | 4 No |
How do you remove spaces in java?
What does this () mean in constructor chaining concept?
What is the difference between arraylist and hashset in java?
What is meant by method overriding?
How do you create a first line indent?
How to convert string to int in java?
What restrictions are placed on method overriding in java programming?
What is an abstract class and what is it’s purpose?
explain copyonwritearraylist and when do we use copyonwritearraylist?
What does you mean in math?
What is Java Classloader?
1 Answers Phantom Technologies,
Explain Stream Tokenizer?