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 / qamar islam

package Qamar;
import java.util.*;




import javax.xml.crypto.dsig.spec.HMACParameterSpec;
public class HashMapExtract {




public static void main(String args[])
{
HashMap<Integer, String> hm=new HashMap<Integer, String>();
hm.put(1, "Qamar");
hm.put(2, "Gulnar");
hm.put(3, "Qamar");
hm.put(4, "Gulnar");
hm.put(51, "Qamar");
hm.put(6, "Gulnar");
Set set =hm.entrySet();

Iterator itr=set.iterator();
while(itr.hasNext())
{
System.out.println("values in hashmap: "+itr.next());
}
}
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the meaning of find and replace?

982


Is string a class in java?

933


Can we declare a static variable inside a method?

958


Give us a program to check for parenthesis matching using stack.

952


Is double bigger than float?

918


Can we override a variable in java?

952


How do you declare an array in java?

993


What is the statements?

1042


What is keyword auto for?

1116


What does it mean to be immutable?

928


What are filterstreams?

1029


What is byte [] in java?

963


What is meant by javabeans?

1033


How do you check if two strings are equal in java?

975


Why do we need strings in java?

946