Questions tagged [try-finally]

try-finally is a clause used to define a block of code which may throw an exception along with instructions to execute regardless of whether an exception occurs or not.

References

182 questions
-3
votes
2 answers

java 6 IO - wrapped streams closing

Consider : public static void read(String filename) throws IOException { String charsetName = "UTF-8"; InputStream file = new FileInputStream(filename); // say no problem InputStreamReader reader = new InputStreamReader(file,…
Mr_and_Mrs_D
  • 32,208
  • 39
  • 178
  • 361
-4
votes
2 answers

Loading .txt file into a 2D String Array

I'm currently working on an assignment and have went through the workbook and java site multiple times and I can't seem to see where I got this wrong. I am trying to import a file into a 2D Array. I am using Scanner w/ BufferedReader and FileReader…
1 2 3
12
13