why the sleep method does not leave the lock and wait method
leave the lock

Answer Posted / balamurugan

Wait Method have parameters as MilliSecond after that
particular time over thread start execution.So Wait Method
Leave the Lock.

But in Sleep() have no any parameter so the thread have no
clue to leave the lock . that's y sleep method does not
leave the lock the programmer need to explicitly write
another method like notify() to execute.

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is lambda expression in mvc?

473


Describe life cycle of thread?

572


What is war file in java?

570


What is a stream in programming?

448


How long can a lambda function run?

468






What is meant by annotation in java?

481


Describe the principles of oops.

492


Is eclipse a jdk?

497


Is it correct to say that using parentheses can only change?

481


What is entitymanager in java?

477


In java thread programming, which method is a must implementation for all threads?

507


Who developed rxjava?

469


Does ms edge support java?

466


What is cache in java?

502


Are the actual permissions for the application defined at run-time or compile-time? : java security

544