-3

You can read this and - How to remove integer value from array list using remove() method

Are they same? What is the best practice among them. If I want to write less code, can I use

list.remove((Integer) 2);
Jens
  • 67,715
  • 15
  • 98
  • 113

1 Answers1

0

List.remove(int index) removes item at index.

List.remove(Integer item) removes first matching item in the list.

Cheng Thao
  • 1,467
  • 1
  • 3
  • 9