try { } finally { }
catch (Exception e) { }
try { } catch (Exception e) { } catch (ArithmeticException a) { }
int[] A;
A[0] = 0;
classes.zip
or rt.jar
.)
end of stream
marker.
end of stream
marker, a program tries to read the stream again.
readList
method to
ListOfNumbers.java
.
This method should read in int
values from a file,
print each value,
and append them to the end of the vector.
You should catch all appropriate errors.
You will also need a text file containing numbers to read in.
cat
method so that it will compile.
public static void cat(File file) { RandomAccessFile input = null; String line = null; try { input = new RandomAccessFile(file, "r"); while ((line = input.readLine()) != null) { System.out.println(line); } return; } finally { if (input != null) { input.close(); } } }