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());

 

posted @ 2019-07-06 11:07  ThisCall  阅读(339)  评论(0编辑  收藏  举报