title: How to make a Java array behave like a JavaScript array?
body: <p>In JavaScript, I can write code like this:</p>
  
  <pre><code>var a = new Array();
  a[2] = 'a';
  a[20] = 'b';
  </code></pre>
  
  <p>and this would not work on Java, the point is I don't want to specific the exact length for it.</p>
  
  <p>How could I keep this happy style when writing java?</p>