title: Java find last member in index of array
body: <p>So let say I have an array of size 10 with index range from 0 to 9.
  I add a bunch of elements in and stop adding at index 6. So with array.length, I can know that the size of the array is 10, but how do I find which index contain the last value and after that is empty? Am I suppose to do a loop and stop at index == null?</p>
  
  <p>I mimic an arraylist by create a dynamic array that grow when the size is full.</p>
  
  <p>Arg, forgot to tell you guys, if the array is int, then the empty slots will be 0? </p>