Sounds like a directly lifted homework question to me. We don't do your homework, but maybe I can give some clues. The keywords "final" and "volatile", plus the technique of immutable objects, are all things that can be used to ensure thread-safety. Of course, missing from this list is the most important keyword, "synchronized". However, there is no magic way of ...