java常见问题 ——编辑报错1

报错1

The method add(CatNode) in the type List<CatNode> is not applicable for the arguments (String)

//
这里如今加泛型,会报错 List<CatNode> resultList=new ArrayList<>(); // The method add(CatNode) in the type List<CatNode> is not applicable for the arguments (String) // List resultList=new ArrayList<>();

//
这里如今加泛型,会报错 // List<CatNode> resultList=new ArrayList<>(); // The method add(CatNode) in the type List<CatNode> is not applicable for the arguments (String) List resultList=new ArrayList<>();

报错举例

resultList.add("/products/"+tbItemCat.getId()+".html|" + tbItemCat.getName());
原文地址:https://www.cnblogs.com/dianzan/p/11142014.html