I know this may be a simple question but so far I haven't found an answer online or on SO for it. I'm working on this school project and basically I need to read a text file and put two different kinds of words into two different arrays. The only difference is that I CAN NOT use an array list. I also need to be able to read any size file meaning that I should be able to re-size it if needed.
Therefore I need to read a file separate two kinds of words and if the file is too large I need to make the array larger. Any thoughts? I was also going to use this to separate the two kinds of words.
String[] a = line.trim().replaceAll("[^A-Z]").toLowerCase().split("\\s+");