Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void readDictionary() throws IOException {
- try {
- File file = new File("English.txt");
- Scanner input = new Scanner(file);
- int count = 0;
- while (input.hasNext()) {
- String word = input.next();
- System.out.println(word);
- count = count + 1;
- }
- System.out.println("number of words: " + count);
- }
- catch (Exception e) {
- System.out.println("couldn't find file");
- // TODO: handle exception
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement