Friday, May 29, 2009

Differences between exceptions and assertions

ExceptionsAssertions
An exception tells the user of the program that something in the program went wrong.An assertion documents a program. When it fails, it informs that the program has a bug.
Exceptions are created to deal with problems that might occur in the program. Assertions are written to state the concepts of a program.
Exceptions are used to test input/output as well as whether parameters are legal or not.Assertions are documentations that can be checked by running the program.

No comments:

Post a Comment