Versions Compared

Key

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

Best practices for creating (Java) exceptions:

1. When deciding on checked exceptions vs. unchecked exceptions, ask yourself "What action can the client code take when the exception occurs?". Use unchecked exception when the client code cannot do anything, otherwise use checked exception. Use a checked exception for conditions client code can reasonably be expected to handle.

...