There is yet another useful keyword available in Java that is used frequently while using Threads. It is the Volatile Keyword.
Think of the first scenario in our chapter on “Stopping Threads”. Our thread expects a value to be updated by some method and this value is checked everytime our thread is going to run inside a loop. Lets say we have implemented synchronization for our run method, we