import java.io.File;
import java.io.IOException;
public class MainClass {
public static void main(String[] argv) {
File myFile = new File(".");
String s = "not a number";
try {
System.out.println("About to call.");
int x = Integer.parseInt(s);
myFile.getCanonicalFile();
System.out.println("Call succeeded.");
}
catch (NumberFormatException xceptn) {
System.out.println("Bad text! " + xceptn.getMessage());
xceptn.printStackTrace();
}
catch (IOException xceptn) {
System.out.println("File stress! " + xceptn.getMessage());
xceptn.printStackTrace();
}
finally {
System.out.println("In the finally block.");
}
}
}
|