1.
nums.forEach((key, value) -> System.out.println( key +" "+ value));
2.
Set<String> num=nums.keySet();
for(String str:num) {
int a=nums.get(str);
System.out.println(str+" "+a);
}
3.
Set<Map.Entry<String, Integer>> numbers=nums.entrySet();
for(Map.Entry<String, Integer> number:numbers) {
System.out.println(number.getKey()+" "+number.getValue());
}
4.
Set<String> numbers=nums.keySet();
for(String number:numbers) {
System.out.println(number+" "+nums.get(number));
}