Are you limited to using standard Java arrays? If not, I'd suggest using the ArrayList class. It can auto-expand as you add elements beyond it's capacity. If not, then you have to do it the manual...