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 are the application of stack?

982


What is locale?

1083


Is ruby built on java?

983


Is null or empty java?

1028


How can you make sure that your singleton class will always return single instance in multi-threaded environment?

1080


What is the biggest integer?

1103


What is set and get methods in java?

1036


Can a lock be acquired on a class in java programming?

1042


Do I need java for windows 10?

1089


how we can make a read-only class in java?

1036


What does system out println () do?

1064


What is an infinite loop? How infinite loop is declared?

1166


How to change the priority of thread or how to set priority of thread?

1071


Differentiate between stringbuffer and stringbuilder in java.

1074


What comes to mind when someone mentions a shallow copy in java?

1164