Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to extract HashMap values?

Answer Posted / siddpany

class hashMap
{
public static void main(String args[])
{
HashMap map = new HashMap();
map.put("key1",200);
map.put("key1",100);
map.put("key1",400);
map.put("key1",700);
Set set = map.keySet();
//for each loop
for(Object object :set)
{
System.out.println(map.get(Object));
}

Is This Answer Correct ?    11 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is contract between hashcode and equal method?

1034


What are the types of relation?

1041


What is meant by null and void?

962


What is the return type of the main method?

1031


What do you mean by a JVM?

1244


What is a null class?

975


What is void class in java?

971


What is a numeric literal?

1072


What is the use of a copy constructor?

986


What steps are taken when the OS shifts from one-thread execution to another?

1362


What is an array length?

897


What is a marker interface?

1153


Is there any difference between synchronized methods and synchronized statements?

1096


Explain the private protected method modifier?

978


Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?

1007