@@ -0,0 +1,1086 @@
+package com.yxy.chukonu.java.jdk18.map;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Apublic class MapExample %7B%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09Map%3CInteger, String%3E map = new HashMap%3C%3E();%0A%09%09for (int i = 0; i %3C 10; i++) %7B%0A%09%09    map.putIfAbsent(i, %22val%22 + i);%0A%09%09%7D%0A%09%09%0A%09%09map.forEach((id, val) -%3E System.out.println(id + %22 = %22 +val));%0A%09%09%0A%09%09map.computeIfPresent(3, (num, val) -%3E val + num);%0A%09%09map.get(3);             // val33%0A%09%09%0A%09%09map.computeIfPresent(9, (num, val) -%3E null);%0A%09%09map.containsKey(9);     // false%0A%09%09%0A%09%09map.computeIfAbsent(23, num -%3E %22val%22 + num);%0A%09%09map.containsKey(23);    // true%0A%09%09%0A%09%09map.computeIfAbsent(3, num -%3E %22bam%22);%0A%09%09map.get(3);             // val33%0A%0A%09%09map.remove(3, %22val3%22);%0A%09%09map.get(3);             // val33%0A%0A%09%09map.remove(3, %22val33%22);%0A%09%09map.get(3);             // null%0A%09%09%0A%09%09map.getOrDefault(42, %22not found%22);  // not found%0A%09%09%0A%09%09map.merge(9, %22val9%22, (value, newValue) -%3E value.concat(newValue));%0A%09%09map.get(9);             // val9%0A%0A%09%09map.merge(9, %22concat%22, (value, newValue) -%3E value.concat(newValue));%0A%09%09map.get(9);             // val9concat%0A%0A%0A%09%7D%0A%0A%7D%0A

add JDK1.8 new feature - Map