Top: Index Previous: Revision on Objects Up: Java Programming Next: IO

CSC8311 -- Advanced Object-Orientated Programming

Exceptions

Live is hard and the plain fact of the matter is that programs break and so does the world around them. Exceptions are a good way of dealing with this.

You have to be able to understand how to use exceptions well; they are the basis for all error handling in Java. Good error handling is the difference between a well-written program and a quick hack. You will find that, even for small programs, dealing with errors well becomes important very rapidly; if it is done badly, you will find it takes far longer to work out what has gone wrong; debugging is rather dull anyway, and you want to spent as little time doing it as possible 1

Please read the entire trail on exceptions, and attempt both exercises.

Talk

Today's talk will be on Subversion and Version Control. Pay attention!


1. I once spent a day debugging a program where I'd written code like this:

     public void method(){
           try{
              doSomething();
           }
           catch( Throwable t ){
              System.exit( 0 );
           }
     }

This is possible the worse code I've ever written (I was learning and it was Friday is my excuse). Anything else would have been better.


Top: Index Previous: Revision on Objects Up: Java Programming Next: IO