Answer:
Explanation:
The two solutions to this problem would be to either count the number of total lines in the input file and initialize the array with the exact number of lines, or use an ArrayList. The first solution would work since it would analyze the file first in order to make sure the array will fit every input line. The second solution will also work since ArrayLists are dynamic and do not have a fixed size. You can simply continue adding to the ArrayList and it will adjust its size accordingly.