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 meaning of find and replace?
Is string a class in java?
Can we declare a static variable inside a method?
Give us a program to check for parenthesis matching using stack.
Is double bigger than float?
Can we override a variable in java?
How do you declare an array in java?
What is the statements?
What is keyword auto for?
What does it mean to be immutable?
What are filterstreams?
What is byte [] in java?
What is meant by javabeans?
How do you check if two strings are equal in java?
Why do we need strings in java?