aspose file tools*
The moose likes Threads and Synchronization and the fly likes difference between NavigableMap and ConcurrentNavigableMap Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "difference between NavigableMap and ConcurrentNavigableMap" Watch "difference between NavigableMap and ConcurrentNavigableMap" New topic
Author

difference between NavigableMap and ConcurrentNavigableMap

meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305

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?


My one regret in life is that I am not someone else.
- Woody Allen
Mike Simmons
Ranch Hand

Joined: Mar 05, 2008
Posts: 2969
    
    9
A ConcurrentNavigableMap has all the methods of a NavigableMap, plus all the methods of a ConcurrentMap. Other NavigableMaps do not have ConcurrentMap methods.

Is it ConcurrentNavigableMap can be modified by different threads only?

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: difference between NavigableMap and ConcurrentNavigableMap
 
Similar Threads
Passing SCJP 6.0 with SCJP 5.0 preparation???
Quick Question HttpSessionBinding vs HttpSessionAttribute Listeners
JATO Vs JDOM
what are the chapters i have to ignore
SCJP 6