I changed the line if (j1 != j2) System.out.println("j");
with if (j1 != j2) System.out.println(j1+"j"+j2);
and found that the condition j1 != j2 is true after going through several loops ..
It seems that after sometime one
thread lags behind the other one