In any programming language, error handling is an important task. In general, when we talk about an unexpected behavior in our program, we refer to two terms: errors and exceptions. We need to distinguish between them to make the appropriate decision for our program.
The term exception is newer to programming than the error. An exception represents an anticipated, but improper case at runtime; whereas an error represents an inaccuracy, which can only be solved by changing the program.
The following ...