I've tested with code(i believe it is 100% like in book):
public class Messager implements Runnable
{
private
String name;
/** Creates a new instance of Messager */
public Messager(String name)
{
this.name=name;
}
public void run()
{
message(1);
message(2);
}
private synchronized void message(int n)
{
System.out.print(name+"-"+n+" ");
}
public static void main(String[] s)
{
new Thread(new Messager("Wallace")).start();
new Thread(new Messager("Gromit")).start();
}
}
and i've got: Wallace-1 Wallace-2 Gromit-1 Gromit-2
But i think there is theoretical chance to get BCE answers.