Created
February 15, 2015 01:06
-
-
Save KowalczykBartek/a4a10244f92f7a688668 to your computer and use it in GitHub Desktop.
sample3
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
static String readFirstLineFromFileWithFinallyBlock(String path) throws IOException { | |
BufferedReader br = new BufferedReader(new FileReader(path)); | |
try { | |
return br.readLine(); | |
} finally { | |
if (br != null) br.close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment