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
What is the purpose of using the java bean?
Is singleton set an interval?
What do u mean by variable?
What is the benefit of inner / nested classes ?
What are the changes in java.io in java 8 ?
How do you convert int to char in java?
Why string is immutable with example?
What is the difference between equals() and == in java?
Why should I use abstract class?
What is an empty class? What functionality does it offer in Java?
If a class is declared without any access modifiers, where can the class be accessed?
Can you start a thread twice in Java?
What do you mean by hashing?
What is charat java?
Can we overload destructor in java?