As you know, an array has a fixed size once it's created. If you need to store a list of items with a variable size, then it's better to use a List (for example an ArrayList or a LinkedList) instead of an array.