【发布时间】:2014-07-01 19:45:04
【问题描述】:
打包在.citydoor.imports.catalog.tools;
公共类 ProductVo {
private String product_id;
private String product_name;
public void ProductVo(String i, String n){
product_id = i;
product_name = n;
}
public String getProductId(){
return this.product_id;
}
public void setProductId(String product_id){
this.product_id = product_id;
}
public String getProductName(){
return this.product_name;
}
public void setProductname(String product_name){
this.product_name = product_name;
}
}
打包在.citydoor.imports.catalog.tools;
导入 java.util.ArrayList;
公共类 CatFeedBean {
ArrayList<ProductVo> parsedList = new ArrayList<ProductVo>();
ArrayList<PriceVo> priceList = new ArrayList<PriceVo>();
ArrayList<SkuVo> SkuList = new ArrayList<SkuVo>();
String[] columns = arryLines.split("/");
//String[] columns;
String productid = columns[0];
String productname = columns[1];
String skuid = columns[2];
String price = columns[3];
**ProductVo productObj = new ProductVo(productid,productname);**
//parsedList.add(productObj);
//SkuVo skuObj = new SkuVo(skuid);
//SkuList.add(skuObj);
//PriceVo priceObj = new PriceVo(price);
//priceList.add(priceObj);
}
在粗体线处,我收到一个错误 - “构造函数 ProductVo(String, String) 未定义”。
【问题讨论】:
-
public void ProductVo没有声明构造函数...它声明了一个名为ProductVo的void方法。删除void部分。