I don't get it. debugSession is never changed in this code So it will be the same for all the threads all the time. Why do we need to mark it as volatile? O course debugSession has a method to change it but the program doesn't use it a single time. In fact, I would mark rather aliveThreadIndex as volatile, because it might be incremented by all threads.... but of course, I can't because of validation that says: "3. The Solution class must have a private static final AtomicInteger aliveThreadIndex field." (volatile and final can not be combined). Can anyone explain it to me?