[5777] in java-interest

home help back first fref pref prev next nref lref last post

Exception handling and throwing

daemon@ATHENA.MIT.EDU (Susan McDaniel)
Mon Feb 26 15:42:21 1996

Date: Mon, 26 Feb 1996 14:19:49 -0500 (EST)
From: Susan McDaniel <mcdaniel@umich.edu>
To: java-interest@java.sun.com


I'm trying to do file i/o and am having some trouble with exceptions. I know 
how to use the try{}catch{}finally{} stuff (or at least I think I do). But
the error message from the compiler says:

Exception java.io.IO Exception must be caught, or it must be declared in the 
throws clause of this method.

What is a throws clause? How do I invoke one? The error is occuring in the 
following line of code:

RandomAccessFile file = new RandomAccessFile(input, "rw");
                        ^


Thanks for any and all help

Susan McDaniel
mcdaniel@umich.edu


-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post