| Exceptions | Assertions |
|---|---|
| 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. |
Like this article? Share it with others
If you like this article, please leave a comment or subscribe this blog via RSS or via e-mail, Bookmark and share through your network. Click the AddThis button below. Thanks.
If you like this article, please leave a comment or subscribe this blog via RSS or via e-mail, Bookmark and share through your network. Click the AddThis button below. Thanks.