| Author |
difference between NavigableMap and ConcurrentNavigableMap
|
meeta gaur
Ranch Hand
Joined: Dec 05, 2012
Posts: 225
|
|
There are some additions to the Java Collection Framework, I tried to find out but could not drill down what is actually difference between "NavigableMap" and "ConcurrentNavigableMap".
Is it ConcurrentNavigableMap can be modified by different threads only?
|
OCAJP
|
 |
Mike Simmons
Ranch Hand
Joined: Mar 05, 2008
Posts: 2770
|
|
A ConcurrentNavigableMap has all the methods of a NavigableMap, plus all the methods of a ConcurrentMap. Other NavigableMaps do not have ConcurrentMap methods.
No - if for some reason you want to modify a ConcurrentNavigableMap using only one thread, that's fine, it will work normally. The point is that if you do have multiple threads accessing a Map, you need a ConcurrentMap.
|
 |
 |
|
|
subject: difference between NavigableMap and ConcurrentNavigableMap
|
|
|