Versions Compared

Key

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

...

A third solution is to provide a non-empty private constructor accessible only from within the class. This solution is not susceptible to reflection based attacks originating from unprivileged code since the AccessibleObject.setAccessible() method requires a security manager check by default.

Code Block
bgColor#ccccff
class BankOperation {
  private BankOperation() {
    // ...
  }
}

...