@fred rosenberger actually I need to create an indexing system where I need to read terms from a collection of files and store the
word ,frequencies and the list of files(file ids).So, what I thought about storing the word,frequency in the hashmap and the file-ids in the arraylist where the words appear.