What kind of problem may occur for this code? I think even exception occurs, this code can throw the exception to its caller. So it does NOT generate any trouble.
How can I improve it?
public static void cat(File named) {
RandomAccessFile input = null;
String line = null;
try {
input = new RandomAccessFile(named, “r”);
while ((line = input.readLine()) != null {
System.out.println(line);
}
return;
} finally {
if (input != null) {
input.close();
}
}
}