I don't understand why Eclipse is giving me an error regarding passing the String returned by the BufferedReader into Hashtable's put(Object,Object) method. I've read the API, I don't recognise any clues. Is it perhaps that it cannot be sure that it will return a unique String?
The String dictionary is set elsewhere in the file,I've stripped this down to the bit that matters - the method in question & anything happening with its variables.
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.Hashtable; public class Model { private Hashtable hash=new Hashtable(); private String dictionary; public void loadWords() throws IOException{ BufferedReader br=null; try{ br=new BufferedReader(new FileReader(dictionary)); do{ hash.put(br.readLine(), new Node<E>); } while(br.readLine()!=null); }catch(IOException iOE){ System.out.println("Fission mailed"); } finally{ br.close(); // Closing the buffered reader } }