public class commonfromtwomap {
public static void main(String[] args) {
Map<String,String> map1=new HashMap<>();
map1.put("nima", "eng");
map1.put("ajay", "ajau");
Map<String,String> map2=new HashMap<>();
map2.put("china", "khj");
map2.put("ajay", "ajau");
Set<Map.Entry<String,String>> coomonen=map1.entrySet();
for (Map.Entry<String, String> entry : coomonen) {
System.out.println("Key: " + entry.getKey() + ", Value: " + entry.getValue());
}
}
}