import java.io.*;
public class ThrowableTest extends FileNotFoundException {
public static void main(String argv[]) {
try {
FileInputStream f = new FileInputStream("D:\\test.txt");
} catch (FileNotFoundException e) {
try {
PrintWriter p = new PrintWriter(new FileOutputStream("D:\\errors.txt"));
p.println("=== toString() ===");
p.println(e.toString()+"\n");
p.println("=== getLocalizedMessage() ===");
p.println(e.getLocalizedMessage());
p.println("=== getMessage() ===\n");
p.println(e.getMessage());
p.println("=== printStackTrace() ===");
e.printStackTrace(p);
p.flush();
} catch (IOException e1) {
e1.printStackTrace();
}
}
}
}