Lecture 20
2
Error handling
•Write code so that running program can
–recognize when an error has occurred
–tell someone
–do something sensible
–
–public void withdraw( int amount )
–{
–    if ( amount <= balance ) {
–        incrementBalance( - amount );
–    }
–    else {
–        // an error; what now … ?
–    }
–}