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 math in java?
What is nan inf?
Why do people says “java is robust”?
Can I declare class as static or private?
How to display arraylist values in java?
Can we inherit inner class?
What’s the difference between applets and standalone program?
who can i handle multiple client in RMI
Why is string class considered immutable?
What is null object in java?
What is a modifier?
What is the basic concepts of OOPS?
What is string args [] in java?
What is a heavyweight component?
What is string syntax?