import java.util.*;
import java.lang.*;
import java.io.*;
// The main method must be in a class named "Main".
class Main {
public static void main(String[] args) {
Map<String,Integer> m=new HashMap<>();
m.put("a",1);
m.put("b",4);
m.put("c",5);
Iterator<String> it=m.keySet().iterator();
while(it.hasNext()){
System.out.println(it.next());
}
Iterator<Integer> it2=m.values().iterator();
while(it2.hasNext()){
System.out.println(it2.next());
}
for(Map.Entry<String,Integer> m_val:m.entrySet()){
System.out.println(m_val.getKey()+" "+m_val.getValue());
}
m.put("a",m.get("a")+1);
for(Map.Entry<String,Integer> m_val:m.entrySet()){
System.out.println(m_val.getKey()+" "+m_val.getValue());
}
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: