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

Answer Posted / vinay kumar

sleep() will wait go to sleep for amount of time that is specified in it.After the times finishes it resumes automatically.

wait() will also wait for some I/O and will NOT resume automatically but will resume only when notify() or notifyall() is called.

Is This Answer Correct ?    19 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of static class?

547


What are conditionals and its types?

592


How many techniques can be employed to create a string object?

559


Does apple use java?

497


What is difference between class and object in java?

530






How thread scheduler schedule the task?

584


What are the different approaches to implement a function to generate a random number?

571


What is heterogeneous in java?

495


What is a Null object?

892


What are the differences between forwarding () method and sendredirect() methods?

622


What is java beans?

576


What is an infinite loop?

548


Why collection is called framework in java?

540


Can a main method be overloaded?

573


What is a concrete classes? Is Java object class is concrete class?

518