Java Collections synchronizedSortedMap() MethodThe synchronizedSortedMap() method of Java Collections class is used to get a synchronized (thread-safe) sorted map backed by the specified sorted map. SyntaxFollowing is the declaration of synchronizedSortedMap() method: Parameter
ReturnsThe synchronizedSortedMap() method returns a synchronized view of the specified sorted Map. ExceptionsNA Example 1Test it NowOutput: Synchronized sorted map is :{1=Whatsapp, 2=Twitter, 3=Facebook, 4=Instagram} Example 2Test it NowOutput: Synchronized sorted map:{1=1001, 2=1002, 3=1003, 4=1004, 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