How to iterate map in collection framework?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is etl process. How many steps etl contains explain with example?

515


What are the various access specifiers in java?

569


how you can record a slide show?

106


What are three versions if splunk?

150


Both labor and machine categories exist. How would you calculate the process time?

608






What types of files you know?

491


What is a thin client and thick client?

137


How do you upgrade pip?

465


What is difference Between Authentication and authorization?

576


What are the different file processing modes supported by python?

497


What are delegates?

798


What is the difference between package dependencies and development dependencies?

259


How do I change the default font in powerpoint 2013?

109


The purpose of the Initiation process is to: A. Formally recognize the existence of a project or project phase B. Formally recognize the need that brought about the project be it marketing demand, customer requests, business need, technological advances, or legal requirements C. Formally recognize the stakeholders of the project and identify them in the project charter D. Formally recognize the project sponsor and document his or her project goals

675


What are different html tags?

450