The problem is not because i=(i+1)%2 is never executed. You can verify this by adding a print statement after the i=(i+1)%2 like 
  System.out.println("i="+i);The problem is because there's a delay in else block, which makes female be overwritten right after the assignment. The sequence is:
  male-----------> delay------------->female-->male ...  So male has much long life than female. If you move the delay out of the else block, you should be able to see all the handsome males and beautiful femals. :-)Suggestion: use synchronized(..) for the thread programming.