Possible Duplicate:
What will store a Key-Value list in Java or an alternate of C# IDictionary in Java?
In C# there is a data structure named IDictionary which stores a collection of key-value pairs. Is there simillar data structure in Java? If so, what is it called and can anybody give me an example of how to use it?
One of the best ways is HashMap:
Use this sample:
Look at this link: http://docs.oracle.com/javase/6/docs/api/java/util/HashMap.html