Java exceptions

An exception is a special object that indicates an interruption to the normal program flow, usually because an error or some other "unusual" condition has occurred. The reason for using exceptions is that they allow the program to jump automatically to the section of code that will handle a particular error or unusual condition, rather than the program having to explicitly check for the error or condition after every line of code.

For more information, see the Java exceptions section of this web site.


If you enjoy this Java programming article, please share with friends and colleagues. Follow the author on Twitter for the latest news and rants.

Editorial page content written by Neil Coffey. Copyright © Javamex UK 2021. All rights reserved.