title: Hashtable<String, Object> not finding strings
body: <p>I have a Hashtable of type Hashtable</p>
  
  <p>I've loaded several strings as keys, one of which is "ABCD"</p>
  
  <p>However, later when I go to look up "ABCD", the Hashtable returns null instead of the associated object. Further the keyset contains "ABCD", but a request to containsKey("ABCD") returns false.</p>
  
  <p>Is this because String objects are inherently different objects?</p>
  
  <p>If so, what is the write way to store information in a Hashtable if I want to use Strings as keys?</p>
  
  <pre><code> public class Field {
          private String name;
          private DataType dataType;
  
          public Field(String name, DataType dataType) {
              this.name = name;
              this.dataType = dataType;
          }
  
          public String getName() {
              return name;
          }
  
          public DataType getDataType() {
              return dataType;
          }
  
          public String toString() {
              return name;
          }
      }
  
  public class Record {
          private Hashtable&lt;String, Data&gt; content; 
  
          public Record(Field[] fieldList) {
              this.fieldList = fieldList;     
              content = new Hashtable&lt;String, Data&gt;();
  
              System.out.println(fieldList.length);
  
              for(Field f : fieldList) {          
                  content.put(f.getName(), new Data());
              }
          }
  
          public void add(String field, String s) {
                      // ERROR OCCURS HERE IN THIS METHOD !!!
  
              System.out.println(field);
  
              for(String ss : content.keySet()) {
                  System.out.print(" [ " + ss + " ] ");
              }
              System.out.println();
  
              System.out.println(content.containsKey(field));     
              System.out.println(content.get(field));
  
              content.get(field).add(s);
          }
  }
  
  
  
  public class Data {
  
      private Vector&lt;String&gt; lines;
      private int index;
  
      public Data() {
          lines = new Vector&lt;String&gt;();
          index = 0;
      }
  
      public void add(String s) {
          System.out.println("adding");
          lines.add(s);
      }
  
      public String nextLine() {
          try {
              return lines.elementAt(index++);
          } catch (ArrayIndexOutOfBoundsException aioobe) {
              return null;
          }
      }
  }
  </code></pre>