Can we call the Thread.sleep in Synchyronozed block?

Answer Posted / muthusenthil

yes, you can call wait method inside synchronized block but
synchronized block usually allows one by one to penetrate
in.if you call wait method inside it will create a stagnant
circumstance. synchronized block wont allow other threads
inside till this thread in waiting state get notified

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is 0 a prime number?

572


Which eclipse is best for java?

525


Can we use string in switch case in java?

574


How can I right-justify a string?

629


What are the important features of Java 11 release?

582






Which one of the following suits the description of a string better: derived or primitive?

514


Why declare Main() method as a static in java ?

598


What is the meaning of variable in research?

561


Can keyword be used as identifier?

547


Does anyone still use java?

582


What is the difference between choice and list?

594


What about instanceof operator in java?

603


What is purpose of keyword void?

568


What is meant by vector class, dictionary class, hash table class, and property class?

685


Is jdk required on each machine to run a java program?

756