I have a ArrayList as shown below:
Id1, value1
Id1, value2
Id2, value1
Id2, value2
Id2, value3
Id3, value1
Id3, value2
Id3, value3
Id3, value4
Id3, value5
etc...
In a class I have id value. I have to fetch the values corresponding to an id value. For example If I give id1 then I need value1 and value2. Which collection mechanism should I use to achieve my objective. I am a beginner please do suggest me. Thanks in advance. All suggestions are welcome.