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
What are meta-annotations?
What are the differences between stringbuffer and stringbuilder?
What happens when heap memory is full?
What is the difference between super class & sub class?
What is the integer of 16?
Can you use abstract and final both with a method?
how to write a program for sending mails between client and server
What is a methodologist?
Explain the difference between jdk, jre, and jvm?
What does it mean that a method or field is “static”?
What is method overloading with type promotion?
What are methods and how are they defined?
Explain different types of thread priorities ?
Is nullpointerexception checked or unchecked?
What is diamond operator in java?