title: Array of Strings without declaring a new array
body: <p>I believe in other languages, you can do the following:</p>
  
  <pre><code>for (String foo : new String[]{"string1", "string2", "string3"}) {
      //do something with foo
  }
  </code></pre>
  
  <p>However with Java, I get an error with</p>
  
  <pre><code>new String[]{"string1", "string2", "string3"}
  </code></pre>
  
  <p>Is something like this possible in Java, or do I have to create the new array like so:</p>
  
  <pre><code>final String[] bar = {"string1", "string2", "string3"};
  for (String foo : bar) {
      //do something with foo
  }
  </code></pre>