Versions Compared

Key

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

...

Code Block
bgColor#FFcccc
final class Flag {
  private boolean flag = true;
 
  public void toggle() {  // Unsafe
     flag = !flag; 
  }

  public boolean getFlag() { // Unsafe 
    return flag;
  }
}

...