報(bào)錯(cuò)——類型列表<學(xué)生>中的添加方法(學(xué)生)不適用于參數(shù)(整數(shù)),求大佬解答
The method add(Student) in the type List<Student> is not applicable for the arguments (Integer),類型列表<學(xué)生>中的添加方法(學(xué)生)不適用于參數(shù)(整數(shù))
The method add(Student) in the type List<Student> is not applicable for the arguments (Integer),類型列表<學(xué)生>中的添加方法(學(xué)生)不適用于參數(shù)(整數(shù))
2020-08-02
舉報(bào)
2020-08-02
已解決,因?yàn)轭愋土斜?lt;學(xué)生>中的添加方法(學(xué)生)不適用于參數(shù)(整數(shù)),所以自定義一個(gè)Integer泛型的List就好了。
具體代碼:List<Integer> intList=new ArrayList<Integer>();