title: Difference between Thread.yield() and Thread.sleep()
body: <p>Can someone explain the difference between <code>Thread.yield()</code> method and <code>Thread.sleep()</code> method?</p>
  
  <p>How I understand it: <code>Thread.yield()</code> gives up the monitor lock to other thread which JVM decides to execute next, and <code>Thread.sleep()</code> puts the current thread in sleep mode for a given amount of milliseconds without giving away the monitor lock.</p>