So i have been coding a project in Java and have come across a pause while trying to reference an array list to another class. The first bit of code is the class I am trying to reference the ArrayList too. The second is where I am creating the ArrayLists.
import Game.App;
public class WordPuzzleGenerator {
public WordPuzzleGenerator() {
if (Game.SizeOfPuzzle.currentRows == 4){
threeLetterWordList
}else if (Game.SizeOfPuzzle.currentRows == 5){
maximum = 12482;
}else{
maximum = 1310;
}
}
Scanner threeLetterScanner = new Scanner(File("3LetterWords.txt"));
ArrayList<String> threeLetterWordList = new ArrayList<String>();
while (threeLetterScanner.hasNext()){
threeLetterWordList.add(threeLetterScanner.next());
}
threeLetterScanner.close();
Scanner fourLetterScanner = new Scanner(File("4LetterWords.txt"));
ArrayList<String> fourLetterWordList = new ArrayList<String>();
while (fourLetterScanner.hasNext()){
fourLetterWordList.add(fourLetterScanner.next());
}
fourLetterScanner.close();
Scanner fiveLetterScanner = new Scanner(File("5LetterWords.txt"));
ArrayList<String> fiveLetterWordList = new ArrayList<String>();
while (fiveLetterScanner.hasNext()){
fiveLetterWordList.add(fiveLetterScanner.next());
}
fiveLetterScanner.close();
}