Answer Posted / 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 |
Post New Answer View All Answers
What is finally block?
Is java 11 paid version?
Can list have duplicates in java?
What is javac_g?
What are the four pillars of java?
Explain about the security aspect of java?
What is the use of :: in java?
Which class contains a method: cloneable or object?
What is jar?
What is the difference between static binding and dynamic binding?
Difference between Linked list and Queue?
What are the special characters?
Name few java 8 annotations ?
What is the final method?
Why does the integer quotient -0/3 yield 0, but the double quotient -0.0/3.0 yields – 0.0?