
Appendix A: What Is Java?626
// do something useful here...
}
catch (AnException ex)
{
// do some error-processing here...
}
catch (AnotherException ex) { ... }
finally
{
// do some cleanup processing here whether or not exception raised
}
Java enforces stricter exception fore-thought by the programmer: uncaught exceptions must
be declared at the top method denition line:
public void readFile(String fileName) throws IOException { . . . }
Unlike MATLAB, which directly interprets source code, Java requires source code to be com-
piled into binary byte-code (aka class-les). This compilation can be done using the command-line
javac compiler, available from ...