I was studying this to understand the behavior of final fields in the new JMM (5 onwards). This concept is clear: guaranteed visibility of initialized final fields to all t
Making all the fields final
will ensure they are published to other threads properly. That comment is probably referring to the following scenario:
private myField;
public void createSomething()
{
myField = new MyImmutableClass();
}
In this case you still need proper synchronization around any access to myField
, or other threads might never see the newly created object.