ArrayList Within HashMap

Hi folks, I'm trying to get an ArrayList within a HashMap in java to improve on an existing ChatBot.
The thing is that I want it to be able to answer a question and retrieve the word from the first contact and compare to the words in the HashMap, than the idea is for a loop make the questions within the ArrayList that is within that HashMap array be asked in order...

Any help with that would be much appreciated.
Cheers.
Rodric MacOliverResearcherAsked:
Who is Participating?
 
Tomas Helgi JohannssonCommented:
Hi!

Here are some examples to look at
http://java.dzone.com/articles/hashmap-%E2%80%93-single-key-and

Hope this helps.

Regards,
     Tomas Helgi
0
 
CEHJCommented:
So what problem are you having with that?
0
 
dpearsonCommented:
If you don't want to write it yourself you can use the Guava library from Google.  They have a map of lists:
http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/collect/ListMultimap.html

You can read about guava, download it etc. from here:
https://code.google.com/p/guava-libraries/

Doug
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.