File f;
try {
f = new File("file.txt");
// More stuff
} catch (FileNotFoundException e1) {
System.out.println("That file doesn't exist!");
f = new File("backupFile.txt");
} catch (SomeOtherException e2) {
// Handle other exception
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter