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