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 |
can we have function for truncating the sign as like abs in oracle.
What are synchronized blocks in java?
Which is the best sorting technique in java?
What is number data type in java?
What are methods?
How can you handle java exceptions?
if we give input as " hi how are you" then the output should be "uoy woh"...it should skip odd words in the input and should reverse even words from the end of string...can anyone help me to write this program in java
which pattern is default in scanner package?
Why bytecode is called bytecode?
What is the covariant return type?
what release of java technology are currently available what do they contain?
Can inner class have constructor?