Created
January 15, 2013 20:21
-
-
Save arn-e/4541686 to your computer and use it in GitHub Desktop.
checked exception handling in Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.FileInputStream; | |
import java.io.File; | |
import java.io.FileNotFoundException; | |
public class FileReaderTest { | |
public static void main(String[] args) { | |
File newFile = new File("./public/sample_file.text"); | |
try { | |
FileInputStream fileStream = new FileInputStream(newFile); | |
} catch(FileNotFoundException exception) { | |
exception.printStackTrace(); | |
throw new RuntimeException("Oh, a Runtime Exception?"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment