Map in Java
HashMap<K, V> map = new HashMap<>(); Map<Integer, String> map = new HashMap<>(); class Test { public static void main(String[] args) { Map<Integer, String> map = new HashMap<>(); map.put(1, “Java”); map.put(7, “Python”); map.put(10, “Ruby”); map.put(3, “Kotlin”); System.out.println(map); } } Output: {1=Java, 3=Kotlin, 7=Python, 10=Ruby} class Test { public static void main(String[] args) { Map<Integer, String> map…
Read More Map in Java