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
What are the three types of Concatenation?
What are the server requirements to install yii2?
How many versions of rss language standards?
HTML 5 provides drag and drop facility. How do you make an image draggable?
Which is a language for finding information in an xml document?
Do we need api key for displaying google maps in android?
What is business purpose of product hierarchy?
How many types of dependency injection are there?
What is casting in java programming?
Is sql developer case sensitive?
What is isblank in excel?
Why we use different sessions in magento?
How cybersecurity might affect the development and implementation of the internet of things (iot), especially in the usa?
What is use of dbms?
What is map side join?