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

Can a function return a function?

550


What are the high-level thread states in java programming?

589


Tell some latest versions in JAVA related areas?

560


What is e in java?

543


What are the basic concepts of OOPS in java?

570






What are the common uses of "this" keyword in java ?

573


Is alive and join method in java?

540


State the main difference between c++ and java?

594


What is space character in java?

575


How to display all the prime numbers between 1 and 100

505


What is the history of java?

548


What is the primitive type byte?

585


What is java lang object?

531


Can we have multiple public classes in a java source file?

558


What is package private scope in java?

535