Java ArrayList remove object - IndexOutOfBoundsException

后端 未结 5 553
长发绾君心
长发绾君心 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:28

    a.remove()
    

    expects to get an integer for the index of the item to be removed. 'A' returns the ASCII value of A which is 64,thus out of the bounds of the array

提交回复
热议问题