posted 22 years ago
If you just want to log it (and if the keys and values are all readable, such as Strings or Integers), just write it to a PrintWriter -> File Writer:
It prints like this
Hash table = {Key1=Value1, Key2=Value2, ... }
If you need to read it back in a program (and if the keys and values are all Serializable or Externalizable), you might want to use a RandomAccessFile <- ByteArrayOutputStream.writeObject( hashMap) or FileOutputStream <- ObjectOutputStream