Java Collections synchronizedNavigableMap() MethodThe synchronizedNavigableMap() method of Java Collections class is used to get a synchronized (thread-safe) navigable map backed by the specified navigable map. SyntaxFollowing is the declaration of synchronizedNavigableMap() method: Parameter
ReturnsThe synchronizedNavigableMap() method returns a synchronized view of the specified Navigable Map. ExceptionsNA Compatibility VersionJava 1.8 and above Example 1Test it NowOutput: Synchronized navigable map is :{1=Google, 2=Facebook, 3=Java, 4=JavaTpoint} Example 2Test it NowOutput: Map before Synchronized map: {1=1001, 2=1002, 3=1003, 4=1004, 5=1005} Synchronized map after remove(4, 1004):{1=1001, 2=1002, 3=1003, 5=1005} Example 3Test it NowOutput: 10 Next TopicJava Collections Class |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India