The following code used to store and retrieve values in hashmap
HashMap<Integer,
String>hmap = new HashMap<Integer,String>();
hmap.put(5,"prak");
hmap.put(1," sachin");
hmap.put(4,"raja");
hmap.put(4,"raja");
Iterator itr= hmap.entrySet().iterator();
while(itr.hasNext())
{
System.out.println(itr.next());
}
Give me idea for this situation. I need to store objects(long empid,String name, int salary, String Designation)in
hashmap , use empid as key for all the objects.