I am reading \"Java Concurrency in practice\" and looking at the example code on page 51.
This states that if a thread has references to a shared object then other t
This will never throw a RunTimeException because your Widgit instance variable w remains null until the constructor code has executed. While your main thread is sleeping in the Widgit constructor, your Checker instance is hitting NullPointerException constantly as the w variable is still null. When your main thread finishes construction, the two int variables in Widgit are equal.