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 treeset and treemap in java?
What is meant by method?
What is the vector class in java programming?
What does substring mean?
What is final keyword?
What is object cloning in Java?
What is the driver class?
What is the independent variable in an experiment?
Why call by value prevents parameter value change?
How many JVMs can run on a single machine and what is the meaning of Just-In-Time (JIT) compiler?
How does class forname work in java?
What is mean by exception?
What about instanceof operator in java?
Which class is used by server applications to obtain a port and listen for client requests?
What will be the output of round(3.7) and ceil(3.7)?