Online Java Compiler By
JavaTpoint.com
import java.util.*; import java.util.concurrent.ConcurrentHashMap; public class ConcurrentHashMapgetExample1 { public static void main(String[] args) { ConcurrentHashMap
maphash = new ConcurrentHashMap
(); maphash.put(1, "AA"); maphash.put(2, "BB"); maphash.put(3, "CC"); maphash.put(4, "DD"); maphash.put(5, "EE"); System.out.println("mappings are: " + maphash); System.out.println(" Value : " + maphash.get(6)); System.out.println(" Value : " + maphash.get(4)); } }
Output