what is the difference between sleep() and Wait()?

Answer Posted / deepak divvela

The main difference is if we need the thread wants to block
particular period of time we just choose sleep().
and when the thread called wait() means it will blocked
untill we will call notify(),notifyAll();

Is This Answer Correct ?    49 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is meant by method?

653


How are the elements of a gridbaglayout organized in java programming?

630


What is hashing in java?

670


java Technical questions asked by JPMC

4669


What language is java written?

633






What is the purpose of void class?

690


How do you reverse a string in java without using string buffer?

662


State one difference between a template class and class template.

715


What is this () in java?

665


What are generic methods?

623


When should I use singleton?

621


Can we define private and protected modifiers for the members in interfaces?

637


What does  mean in regex?

658


In which order the iterator iterates over collection?

678


Explain the differences between abstraction and encapsulation?

631