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 autoboxing and unboxing?

947


What are inner classes or non static nested classes in java?

1119


Which package is always imported by default?

1036


What is the use of arrays tostring () in java?

986


Explain about data types?

1000


Where is jre installed?

983


What are reference variables in java?

1066


What is the difference between preemptive scheduling and time slicing?

1003


What is the size of int in 64-bit jvm?

1011


Can a class have multiple superclasses?

1076


What are the different types of java?

989


What is initial size of arraylist in java?

992


How can a gui component handle its own events?

1042


How is hashcode calculated in java?

980


Explain importance of finally block in java?

980