August 2004
Intermediate to advanced
480 pages
9h 41m
English
At nearly any point in your code, you could just do the following:
throw new RuntimeException();
And off your program goes, to the next block of code in your app that is prepared to handle such a statement. That is definitely changing the flow of your application abruptly.
What do you do when an exception crops up? You can do one of two things: you can deal with it or you can make someone else deal with it.
To deal with it, catch the exception in a catch block and do some real work to handle the situation. Perhaps this just means printing a user-friendly message to the screen so that the user knows what is happening and can notify someone. It could mean logging the problem and sending an e-mail—whatever is appropriate ...
Read now
Unlock full access