Java Collections synchronizedNavigableSet() MethodThe synchronizedNavigableSet() method of Java Collections class is used to get a synchronized (thread-safe) navigable set backed by the specified navigable set. SyntaxFollowing is the declaration of synchronizedNavigableSet() method: Parameter
ReturnsThe synchronizedNavigableSet() method returns a synchronized view of the specified Navigable Set. ExceptionsNA Compatibility VersionJava 1.8 and above Example 1Test it NowOutput: Synchronized navigable set is :[Facebook, Google, Instagram, JavaTpoint] Example 2Test it NowOutput: Set before Synchronized navigable set: [1001, 1002, 1003, 1004, 1005] Synchronized navigable set after remove(1004):[1001, 1002, 1003, 1005] Example 3Test it NowOutput: 1000 Example 4Test it NowOutput: Set before Synchronized navigable set: [1001, 1002, 1003, 1004, 1005] Set after Synchronized navigable set- 1001 1002 1003 1004 1005 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