Answer Posted / srikanth
package com.sri;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
public class entry {
public static void main(String[] args) {
try{
HashMap<Integer,Integer>tm=new
HashMap<Integer,Integer>();
tm.put(100,200);
tm.put(200,101);
tm.put(600,700);
tm.put(700,103);
tm.put(900,104);
Set s=tm.entrySet();
Iterator it=s.iterator();
while(it.hasNext()){
Map.Entry me=(Map.Entry)it.next();
System.out.println(me.getKey()
+"......"+me.getValue());
}
}catch(Exception e){
e.printStackTrace();
}
}
}
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Mention some interfaces implemented by linked list in java.
Write a program in java to create a doubly linked list containing n nodes.
What is the difference between hashset and treeset in java?
What is ph and buffers?
What is the final access modifier in java?
What are the steps involved to create a bean?
Is the empty set a singleton?
What are variable names?
What is singleton class in java and how can we make a class singleton?
What is the tradeoff between using an unordered array versus an ordered array?
Explain about the main() method in java?
What is the maximum size of arraylist in java?
What is the full meaning of java?
What is the main use of generics in java?
What is volatile data type?