Versions Compared

Key

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

...

  • Understand what the superclass does and watch out for mutating functionality
  • Make sure that new methods that are added to the superclass are overridden appropriately if there is some division of logic
  • Never modularize in absurd ways as is apparent in the noncompliant code example

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

Code Block
bgColor#FFCCCC

protected void overdraft() { // this method ia added at a later date
  throw new IllegalAccessException(); 
}

Noncompliant Code Example

...