What are the two ways you can synchronize a block of code?
Answer Posted / ajay tiwary
The way you can synchronize the block is:-
synchronized(dummy object)
{
//synchronized statement
}
In dummy object you can use this or u can create a dummy
object by using new Keyword.
What answer Vikki is posted as the first one is not the way
of synchronizing the block but it's a way to synchronizing
a method.
Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What is the gregoriancalendar class in java programming?
How can we find the actual size of an object on the heap?
Explain the importance of thread scheduler in java?
Describe the process as to how substring() methodology mechanisms in java.
What are sets in java?
what is an objects lock and which objects have locks? : Java thread
What is local class in java?
Why array is used in java?
When can an object reference be cast to an interface reference in java programming?
What is meant by tab pans?
Describe different states of a thread.
What does it mean to flush a file?
What is extension method in java?
What are predicates in java 8?
What is the original name of java?