Java Vector replaceAll() MethodLast Updated : 17 Mar 2025 The 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 1Output: Vector elements: [10, 2, 30, 40, 2] New vector elements: [10, 20, 30, 40, 20] Example 2Output: Vector elements: [Java, Python, Android, Java, Ruby] New vector elements: [tpointtech, Python, Android, tpointtech, Ruby] Next TopicJava Vector |
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India