Java ConcurrentHashMap values() MethodThe values() method of ConcurrentHashMap class returns a Collection view of the values contained in this map. The collection is stacked by the map, so changes to the map are reflected in the collection, and vice-versa. The collection supports element removal, which removes the corresponding mapping from this map, via the Iterator SyntaxParameterNo parameter is passed. Returnsthe collection view ThrowsNo exception is thrown. Example 1Test it NowOutput: mymap2 :[101, 102, 103] mymap :[Java, angular, JavaScript] comparing mymap and mymap2 :false Example 2Test it NowOutput: HashMap : [100, 200, 300, 400]
Next TopicJava ConcurrentHashMap
|