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