NullPointerExcetion Native Method Accessor… Hashing Words Issue

This whileloop is strange: while (scanner.hasNextLine()) { String line = scanner.nextLine(); while (line != null) { String word = scanner.next(); addWord(word, linecount); } linecount++; } If your input file is: Then scanner.nextLine() would be return a, then scanner.next() would return b, because nextLine returns the next end-line delimited String, and next returns the next token … Read more