<<< throws declaration | Index | throwing IOException example >>> |
A method that catches the IOException
public static int getRecordCount2() { try { long length = getFileLength(); // may throw // IOException int recordCount = (int) ( length / RECORD_SIZE ); return recordCount; } catch ( IOException ex ) { System.err.println( "IO error occurred" ); return 0; } }
<<< throws declaration | Index | throwing IOException example >>> |