Add code examples for Java volatile keyword (should be used with Java 5+)