Forum

Number Of Page View:100,000+/Months
LOGIN |New User

Reply

What is the difference between yield() and sleep()? 

Thread.sleep(1000) method hands over the control to other thread for a particular time period. Whereas Thread.yield() method causes the currently executing thread object to temporarily pause and allow other threads to execute according to the scheduling algorithm the CPU is running on.