What kind of problem may occur for this code?
- public RandomAccessFile
throws FileNotFoundException
. - public final String readLine()
throws IOException
. - public void close()
throws IOException
.
Since public class FileNotFoundException
extends IOException
You can change your method to:
public static void cat(File named) throws IOException
And now you don't need a try-catch blocks.
And the caller should catch the exception
thrown by the method.
But why don't you want to catch
the exceptions?