How to iterate map in collection framework?



How to iterate map in collection framework?..

Answer / navin kumar

Map<String,String> map = new HashMap<String,String>();
map.put("A","Rohan");
map.put("C","Sohan");
map.put("B","Ram");

for(String key : map.entrySet()){
sop(key);//A,C and B as key
sop(map.get(key))//Rohan,Sohan and Ram as values
}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Software Interview Questions

What is the difference between Requirement type Determination and Schedule line category determination ?

0 Answers  


Explain Inter company Sales process

0 Answers  


How to ignore some file in mvc

1 Answers   Chetu India,


How to iterate map in collection framework?

1 Answers   Mind Infotech,


paypal interview questions

0 Answers   PayPal,






i have 10,000 records in one input file i want to sort 1 to 5000 records in one out file and remaining records sort in another out file file write syntax?

1 Answers  


A alone can do a piece of work in 6 days and B alone in 8 days. A and B undertook to do it for Rs. 3200. With the help of C, they completed the work in 3 days. How much is to be paid to C?

1 Answers   Zoho,


If selling price is doubled, the profit triples. Find the profit percent

1 Answers   Zoho,


In Material Master, in which tab you will find the Loading Group?

0 Answers  


What is the movement Type for Sales?

0 Answers  


A bank offers 5% compound interest calculated on half-yearly basis. A customer deposits Rs. 1600 each on 1st January and 1st July of a year. At the end of the year, the amount he would have gained by way of interest is:

0 Answers   Zoho,


UI Development questions

0 Answers  


Categories