Computer Science, asked by scera2633, 1 year ago

How to move specific item in array list to the first item in Java?

Answers

Answered by beautygirll56
0

How to move specific item in array list to the first item in Java...

Get the position (index) of the item using the indexOf() method of the ArrayList class.

Remove it using the remove() method of the ArrayList class.

Finally, add it to the index 0 using the add() method of the ArrayList class.

Similar questions