public class Chess implements Runnable
{
public void run()
{
move(Thread.currentThread().getId());
}
synchronized void move(long id)
{
System.out.println(id+" ");
System.out.println(id+" ");
}
public static void main(
String args[])
{
Chess ch=new Chess();
new
Thread(ch).start();
new Thread(new Chess()).start();
}
}
In the K&B book...the say the answer can be.....4 2 4 2...how???