I\'m trying to illustrate the use and importance of volatile with an example that would really not give a good result if volatile was omitted.
volatile
To illustrate the importance of the volatile keyword when it comes to concurrency, all you need to do is make sure that the volatile field is modified and read in a separate threads.