Hi all,
I got my assignment a couple of days ago and started reading Andrew's book on
SCJD 1.5...
I found a problem on page 99 - the implementation of run() method . Well I expected the code to be like the following below:
synchronized(
this.lockA){
System.out.println(name + " : locked " + lockA );
delay(name);
System.out.println(name + " : trying to get " + lockB);
synchronized(
this.lockB){
System.out.println(name + " : locked " + lockB);
}
}
this is how it looks in the book now:
synchronized(
lock1){
System.out.println(name + " : locked " + lockA );
delay(name);
System.out.println(name + " : trying to get " + lockB);
synchronized(
lock2){
System.out.println(name + " : locked " + lockB);
}
}
Please correct if I am wrong...
Is there any document that describes eventual syntax errors!
Thanks...