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