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
Define the term string pool?
Why java is considered dynamic?
How a string is stored in memory?
What is user defined exception in Java?
Does java have extension methods?
Is age discrete or continuous?
Can we override a variable in java?
Is null or empty java?
How do you represent a space in regex java?
Can you add null to a list java?
What function extracts specified characters from a string?
What is the diffrence between inner class and nested class?
What is the difference between int and integer in java?
How will you compute size of a structure?
What is serialversionuid?