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

How can we break singleton in java?

902


In a class implementing an interface, can we change the value of any variable defined in the interface?

1023


How do you sort in java?

939


What is numeric function?

948


Can you extend singleton class?

1035


What do bitwise operators do?

952


Explain wrapper classes in java?

939


Is it possible to write a regular expression to check if string is a number?

971


What is token in java?

960


What is thread start?

913


Is space a char?

880


What are thread priorities and importance of thread priorities in java?

1061


What is a void method?

880


Write a function to find out longest palindrome in a given string?

1003


What is an association?

939