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

How to make a class or a bean serializable?

537


What is array initialization in java?

486


Why arraylist is not synchronized in java example?

463


Is double bigger than float?

538


Which is fastest collection in java?

557






Is Java a dying language?

564


How can a gui component handle its own events?

586


How do you remove all elements from an arraylist in java?

499


What is stringwriter?

535


What is the java virtual machine?

576


Does java isempty check for null?

565


What are the major advantages of internal iteration over external iteration?

566


explain different ways of using thread? : Java thread

569


Can we change the value of static variable?

490


How to obtain a performance profile of java program

540