title: New/strange Java "try()" syntax?
body: <p>While messing around with the custom formatting options in Eclipse, in one of the sample pieces of code, I saw code as follows:</p>
  
  <pre><code>/**
   * 'try-with-resources'
   */
  class Example {
      void foo() {
          try (FileReader reader1 = new FileReader("file1"); FileReader reader2 = new FileReader("file2")) {
  
          }
      }
  }
  </code></pre>
  
  <p>I've never seen <code>try</code> used like this and I've been coding in Java for 9 years! Does any one know why you would do this? What is a possible use-case / benefit of doing this?</p>
  
  <p>An other pieces of code I saw, I thought was a very useful shorthand so I'm sharing it here as well, it's pretty obvious what it does:</p>
  
  <pre><code>/**
   * 'multi-catch'
   */
  class Example {
      void foo() {
          try {
          } catch (IllegalArgumentException | NullPointerException | ClassCastException e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>