Comment mettre tous les mots d'un fichier dans un tableau java

import java.util.ArrayList;

ArrayList<String> words= new ArrayList<>();
    while (x.hasNext()) {
        String a = x.next();
        words.add(a);
    }
Real Raccoon