import com.hft.collections.concurrent.ConcurrentHashMap; public class HFTCollectionsExample { public static void main(String[] args) { ConcurrentHashMap<String, Integer> map = new ConcurrentHashMap<>(); map.put("apple", 10); map.put("banana", 5); map.put("orange", 8); int quantity = map.get("apple"); System.out.println("Apple quantity: " + quantity); map.put("apple", 15); quantity = map.get("apple"); System.out.println("Updated apple quantity: " + quantity); map.remove("banana"); System.out.println("After removing banana: " + map); } }


上一篇:
下一篇:
切换中文