Please suggest an idea in collection to get array like this:
{
{id=>1, name=>"aa"},
{id=>2, name=>"bb"},
{id=>3, name=>"cc"}
}
If I iterate through the array, the first time I give id means it should give 1 and the second time 2 should come.
public class obj{String id;
String name;}
and then have some thing like
List<obj>, or ArrayList<obj>Map<obj,String> mp=new HashMap<obj, String>();