Can we call the Thread.sleep in Synchyronozed block?

Answer Posted / veerendra

While the thread is sleeping in a synchronised block means,
you are locking a resource, there might be 'n' number of
contenders for this resources. If the thread goes to sleep
then other threads or processes contending for the resource
will be blocked infinitely.

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I want to persist data of objects for later use. What’s the best approach to do so?

507


Write a program to reverse a number in java?

564


What is character in data type?

553


How do you download stubs from Remote place?

1359


How define set in java?

514






Where are register variables stored?

593


Write a function for palindrome and factorial and explain?

661


Name container classes in java programming?

597


Can memory leak happen java?

598


Why parsing is done?

505


Is string an object?

656


Can we rethrow the same exception from catch handler?

566


When should I use a singleton?

561


What are kinds of processors?

571


What is backdrop?

596