I feel ArrayList would be a better way to implement the stuff you are trying.