title: java - reading a hashtable from a text file
body: <p>I have two files - <code>write.java</code> and <code>read.java</code>. The write.java file writes a hashtable into the text file and the function of read.java is to read that hashtable from the text file.</p>
  
  <p>write.java:</p>
  
  <pre><code>Hashtable hash1 = new Hashtable();
  hash1.put("1", "Hi!");
  
  FileWriter fileWriter = new FileWriter("abc.txt");
  BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);
  bufferedWriter.write(hash1.toString());
  bufferedWriter.close();
  </code></pre>
  
  <p>It writes peroperly into the text file. Now read.java has to read this hashtable from abc.txt and then add one more key value paid. What is the best way to achieve this?</p>
  
  <p>read.java:</p>
  
  <pre><code>String dnstemp = "abc.txt";
  FileReader fileReader = new FileReader(dnstemp);
  BufferedReader bufferedReader = new BufferedReader(fileReader);
  String line = bufferedReader.readLine();
  bufferedReader.close();
  </code></pre>
  
  <p>But the <code>line</code> variable is a string...how to convert it into a hashtable to perform further operations?</p>