title: Thread Synchronization - How to execute threads alternatively
body: <p>I have been trying to solve a problem involving thread communication using wait() and notify(). Basically i have 2 threads T1 and T2 and i want them to be executed in the following order</p>
  
  <p>T1 , T2, T1, T2 ..... How can i achieve that?</p>
  
  <p>Actual Problem: There are 2 threads T1 - which prints odd numbers (say 1 - 100) and T2 - which prints even numbers (1 - 100). Now, the output should be 1, 2, 3, 4 , 5 , .... 100</p>