title: Problem with "scopes" of variables in try catch blocks in Java
body: <p>Could anyone explain me why in the last lines, br is not recognized as variable? I've even tried putting br in the <code>try clause</code>, setting it as <code>final</code>, etc. Does this have anything to do with Java not support closures? I am 99% confident similar code would work in C#.</p>
  
  <pre><code>private void loadCommands(String fileName) {
      try {
          final BufferedReader br = new BufferedReader(new FileReader(fileName));
  
          while (br.ready()) {
              actionList.add(CommandFactory.GetCommandFromText(this, br.readLine()));
          }
      } catch (FileNotFoundException e) {
          e.printStackTrace();
      } catch (IOException e) {
          e.printStackTrace();
      } finally {
          if (br != null) br.close(); //&lt;-- This gives error. It doesn't
                                      // know the br variable.
      }       
  }
  </code></pre>
  
  <p>Thanks</p>