title: Java ArrayIndexOutOfBoundsException and I don't know why or what to do
body: <pre><code>public void addTransaction(Transaction t){
      mSize++;
      Transaction[] temp = new Transaction[mSize];
      System.arraycopy(mTransactions, 0, temp, 0, mSize - 1);
      temp[-1] = t // ERROR HERE
      mTransactions = temp;
  }
  </code></pre>
  
  <p><code>temp[-1]</code> should replace the last element of temp, which is empty, with the passed argument t, but instead errors.</p>
  
  <p>As long as temp's size is greater than 1, this exception shouldn't happen right? All it's trying to do is modify the last element.</p>