Java ArrayList remove object - IndexOutOfBoundsException

后端 未结 5 559
长发绾君心
长发绾君心 2020-12-07 01:46

I am trying to remove an object from an ArrayList, but I keep getting an IndexOutOfBounds Error. Now there is plenty information available why this happens when iter

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-07 02:11

    The remove method expects an index and it removes an item at the specified index. You are passing a char, thus it is converted to an integer 65.

提交回复
热议问题