Q: print in one line the values of a map public static void main(String[] args) { Map<Integer, String> map = new HashMap<>(); map.put(1, "One"); map.put(2, "Two");
Anoniem
for(Map.Entry m : map.entrySet()){ system.out.println( m.getKey()+" "+m.getValue());