Java Vector replaceAll() MethodThe replaceAll() method of Java Vector class is used to replace each element of the list with the result of applying the operator to that element. SyntaxFollowing is the declaration of replaceAll() method: Parameter
ReturnThe replaceAll() method does not return anything. ExceptionsNullPointerException- This method has thrown an exception if the specified operator is null or if the operator result is a null value and this list does not permit null elements. Compatibility VersionJava 1.2 and above Example 1Test it NowOutput: Vector elements: [10, 2, 30, 40, 2] New vector elements: [10, 20, 30, 40, 20] Example 2Test it NowOutput: Vector elements: [Java, Python, Android, Java, Ruby] New vector elements: [JavaTpoint, Python, Android, JavaTpoint, Ruby] Next TopicJava Vector |
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