how to put all words from a file in an array java code example
Example: how to put all words from a file in an array java
import java.util.ArrayList;
ArrayList<String> words= new ArrayList<>();
while (x.hasNext()) {
String a = x.next();
words.add(a);
}