Answer Posted / maninder kaur
thread locking is achieve by synchronized keyword.
for eg...
public synchronized void disp()
{
}
or
public void disp()
{
synchronized(this)
{
}
}
it makes a lock on disp method until we comes to the end of the block.
so that no other thread can modify it.
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
Can we pass null as argument in java?
What all methods are used to prevent thread execution ?
What is a function easy definition?
What is scanner in java?
Which non-unicode letter characters may be used as the first character of an identifier?
Write down program for following scenario. Use java coding standard. You have array list with some words in it..we will call it as dictionary….and you have a arbitrary string containing some chars in it. You have to go through each word of dictionary and find out if that word can be constructed with the help of chars from arbitrary string given. If you find the word print it else print none.
What are dot operator queries?
What does you mean in math?
What are thread priorities and importance of thread priorities in java?
What are constructors in java?
Are static members inherited to sub classes?
What is string and example?
What are alternatives to java serialization?
What is sleep method?
What is boolean query?