I have a program that reads from a file, takes each word and adds it to an array as a String. I\'m having a bit of trouble with adding the Strings to the array. I get the e
Arrays in java have a static number of slots. You have to know the number you need at the time you instanciate the array.
What you want is either:
array[count] = element;
or you can use a List (e.g. ArrayList, since List is just an interface)
List
ArrayList
interface