import java.util.*;
import java.io.*;
public class Hangman {
public static void main (String [] args) throws IOException{
// importing file for wordbank
// File wordbank = new File("words.txt");
Scanner scan = new Scanner( new File ("words.txt"));
String [] wordBank = new String [20];
while ( scan.hasNext() ){
for(int x = 0; x < 10; x++){
String line = scan.nextLine();
wordBank[x] = line;
}
}
System.out.println( wordBank[1]);
}
}
my error are below. Im not sure what this means.
Exception in thread "main" java.io.FileNotFoundException: words.txt (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.util.Scanner.<init>(Unknown Source)
at Hangman.main(Hangman.java:8)