Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#ccccff
public class Container<K,V> {
  volatile Map<K,V> map;
  // ...
}

This also applies to Similarly, declaring immutable sub-objects by enabling as volatile enables their safe publication, in that, once published, it is impossible to change the state of the sub-object.

...