How to move specific item in array list to the first item in Java?
Answers
Answered by
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
Hindi,
6 months ago
Science,
6 months ago
English,
6 months ago
Computer Science,
11 months ago
Computer Science,
11 months ago
Biology,
1 year ago
Biology,
1 year ago