Versions Compared

Key

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

...

This compliant solution overrides the overdraft() method and throws an exception to prevent misuse of the overdraft feature.

Code Block
bgColor#ccccff
class SubClass extends SuperClass {
// ...
  protected void overdraft() { // this method ia added at a later date
  override
    throw new IllegalAccessException(); 
  }
}

Noncompliant Code Example

...