title: How to increase an array's length
body: <p>I have a quick question. I have an integer array in java that needs its length to vary throughout the class. Specifically, I need it to increase by one in certain situations. I tried  it like this.</p>
  
  <pre><code>        sbgHeadX = new int[ numberOfSBG ];
  </code></pre>
  
  <p>I would increase the integer variable numberOfSBG when I needed to, but I don't think this works. Is there any other way?</p>