Java Collections synchronizedCollection() MethodThe synchronizedCollection() method of Java Collections class is used to get a synchronized (thread-safe) collection backed by the specified collection. SyntaxFollowing is the declaration of synchronizedCollection() method: Parameter
ReturnsThe synchronizedCollection() method returns a synchronized view of the specified collection. ExceptionsNA Compatibility VersionJava 1.5 and above Example 1Test it NowOutput: Synchronized view is :[A, B, C, D, E] Example 2Test it NowOutput: Synchronized view is :[44, 55, 99, 77, 88, 66] Example 3Test it NowOutput: JavaTpoint SSSIT JavaTpoint SSSIT 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