Small white one, excuse me how from the image below int index into the Object O type switch, automatic identification has been index, I press the up and down key is useless,
CodePudding user response:
It's not a question of IDEA, this is because the ArrayList has two overloaded the remove method:
public Boolean remove (Object o); Public E remove (int index);
Compiler is according to the signature of the method to determine which overloads, call when you use the remove (100), the compiler to find matching method is to remove (int index), rather than remove (Object o), if you want to call the latter, can be changed to:
list. Remove (Integer. The valueOf (100));
After packing number is an Object, the compiler to find matching method is to remove (Object o)