What is the function of the set(int index, E element) and replaceAll(UnaryOperator operator) methods of the List interface?

What is the function of the set(int index, E element) and replaceAll(UnaryOperator<E> operator) methods of the List interface?



Answer: set() will replace the element at the specified position with the provided element. replaceAll() will apply the provided function to all elements of the list.


Learn More :

Data Structures

Learn More Multiple Choice Question :