<<< Throw/rethrow exception example | Index | Rethrow example >>> |
Code that throws an IOException for testing purposes
try { // code that reads the first line of a file if ( true ) { throw new IOException( "I/O exception test" ); } return firstLine; } catch ( IOException ex ) { // code to handle IOException goes here }
<<< Throw/rethrow exception example | Index | Rethrow example >>> |