import java.util.HashMap; public class Demo { public static void main(String args[]) { HashMap<Integer, Integer>m = new HashMap<Integer, Integer>(); m.put(10, 20); m.put(30, 40); m.put(50, 60); m.put(70, 80); m.put(90, 100); m.put(110, 120); m.put(130, 140); m.put(150, 160); System.out.println("Displaying values from HashMap..."); for (Integer i: m.keySet()) { System.out.println(m.get(i)); } } }
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more