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
Can you declare a private method as static?
What is command line argument in java?
What is a prefix function.write down a code to compute prefix function.
What is get () in java?
What is string in java is it a data type?
What is bytecode verifier?
What is the use of put method?
What is the best way to findout the time/memory consuming process?
What is toarray method in java?
If goto and const is reserve words than why it is not work in java?
How do you compare objects in java?
What are the classes of java?
What is entry in java?
How do you take thread dump in java?
What function extracts specified characters from a string?