有关Java泛型的问题

问题遇到的现象和发生背景

删除不了商品

问题相关代码,请勿粘贴截图

public class Phone {
private String name;
private String color;
private double price;
private int num;
}

static Collection c=new ArrayList<>();
public static void main(String[] args) {
System.out.println("请输入要删除商品的编号:");
int m=sc.nextInt();
deleteGoods(m);
public static void deleteGoods(int m){
c.remove(m);
System.out.println("商品出库成功,出库后仓库商品如下:");
showGoods();
}
}

运行结果及报错内容

有警告Collection中可能不包含Integer
Java HotSpot(TM) 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been append

我的解答思路和尝试过的方法
我想要达到的结果

int m=sc.nextInt(); 只能输入int类型
static Collection c=new ArrayList<>();
这个Collection代表可能不是int的封装类型集合

https://www.jetbrains.com/help/idea/debug-asynchronous-code.html
https://blog.csdn.net/qiuyeyijian/article/details/104417575
看下这两个网址内容吧

我后面发现把Collection接口换成List接口就可以了,因为List接口的remove(int indext);而Collection的remove(object 0);