Attached is the code for Exercise 9-2 in Sierra and Bates' book. I do not understand why we have to use "letter" in synchronized(letter). I do not know why "this" would not work in this example. Further, on page 523 of the book, they mentioned to use some third-party object as the lock. I am totally confused. Thank you for your help.
// Sierra book - Ex 9-2
Edited by Corey McGlone: Added CODE tags
[ February 24, 2004: Message edited by: Corey McGlone ]