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
These static constructors are correct ? class A { statc intA() { } static A(int x,int y) { } static A(int x) { } }
What is * argv?
Is age discrete or continuous?
How are destructors defined in java?
What is mutable object and immutable object?
What do you understand by java virtual machine?
Define "Access specifiers" in java.
Why do we use regex?
Can we declare a class as static?
Explain OOPs concept.
What is parameters example?
What is the difference between choice and list?
What is charat java?
What is port number in java?
What is the role of garbage collector in java?