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
How large is a boolean?
What happens if I remove static from main method?
What is the nested interface?
Write a java program to generate fibonacci series ?
Mention a package that is used for linked list class in java.
List some features of the abstract class.
What is the base class of all exception classes in java?
What is the final blank variable?
What is the static method?
What is use of super keyword in java?
Explain the features of interfaces in java?
Where is jre installed?
How can constructor chaining be done by using the super keyword?
What is a arraylist in java?
What is regex used for?