Online Java Compiler By
JavaTpoint.com
import java.util.*; import java.util.concurrent.ConcurrentHashMap; public class ConcurrentHashMapgetExample2 { public static void main(String[] args) { ConcurrentHashMap
maphash = new ConcurrentHashMap
(); maphash.put("A1", "AA"); maphash.put("A2", "BB"); maphash.put("A3", "CC"); maphash.put("A4", "DD"); maphash.put("A5", "EE"); System.out.println("mappings are: " + maphash); System.out.println(" Value : " + maphash.get("A1")); System.out.println(" Value : " + maphash.get("A5")); } }
Output