Java錯誤:The type List is not generic; it cannot be parameterized with arguments

新建一個List:

List<Integer> list = new ArrayList<Integer>();

提示以下錯誤:

The type List is not generic; it cannot be parameterized with arguments <Integer>

原因:導入的包錯了,不應該是awt包,而應該是util包

import java.util.List;

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章