title: Directly setting values for an ArrayList in Java
body: <p>Setting a list of values for a Java ArrayList works:</p>
  
  <pre><code>Integer[] a = {1,2,3,4,5,6,7,8,9};
  ArrayList&lt;Integer&gt; possibleValues2 = new ArrayList&lt;Integer&gt;(Arrays.asList(a));
  </code></pre>
  
  <p>However, the following doesn't work and has the error "Illegal start of type" as well as other. Why not? Since the first line in the first code block is simply assignment, shouldn't it not have an effect? </p>
  
  <pre><code>ArrayList&lt;Integer&gt; possibleValues2 = new ArrayList&lt;Integer&gt;(Arrays.asList({1,2,3,4,5,6,7,8,9}));
  </code></pre>