HashMap Problem

I am supposed to create a program that reads a text file that contains a chunk of a database, takes the information and creates a hash of the data, then take the hash and create a binary file. The problem i am having is, 1st i'm not to familiar with java, so i basically know the basics, but not much more, and 2nd, the only sample code i've found on hashmaps is where you have a key and a single value. THis would be all good if it weren't for the fact that in the text file i basically have a key(the ID #), then a bunch of values after that (author, title, journal, etc..), so the problem i have is how do i create a hash from that. Can anybody provide some sort of source code that illustrates what direction i am supposed to be going with this program?


  • hi,

    take a look at this:

    http : // www .java2s.com/Code/Java/ Collections-Data-Structur/SimpledemonstrationofHashMap.htm

    you'll find there ways to read text files and write binary files.

    good luck!:)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion