Computer Science, asked by sonamdhera7442, 1 year ago

How to replace an element of an ArrayList in Java?

Answers

Answered by kaustubdevadiga18
0

You can use the set() method of java.util.ArrayList class to replace an existing element of ArrayList in Java. The set(int index, E element) method takes two parameters, first is the index of an element you want to replace and second is the new value you want to insert.

hope this answer is helpful

<marquee>☺️⚡✌️☺️⚡✌️please mark me as brainllest answer☺️✌️✌️✌️☺️☺️⚡⚡

Answered by NikhilCr7jr
0
you can use the set () method of Java.util. arraylist class to replace an existing element of arraylist in Java. the set method takes two parameters , first is the index of an element you want to replace and second is the new value you want to insert.
Similar questions