我有一个对象类
public class Service {
private Integer vlan;
private String desc;
private String vrf;
private String address;
private String JR;
public Service() {
}
public Service(Integer vlan, String desc, String vrf, String address, String JR) {
this.vlan = vlan;
this.desc = desc;
this.vrf = vrf;
this.address = address;;
this.JR = JR;
}
public Service(Integer vlan) {
this.vlan=vlan;
}
我想将它们在 excel 文件中的数据添加到 listArray
try {
Workbook workbook = Workbook.getWorkbook(new File("Taza-BLR.xls"));
Sheet sheet = workbook.getSheet(0);
for(int i=1;i<sheet.getRows();i++)
{
liste.add(new Service(sheet.getCell(7, i).getContents()));
}
} catch (IOException ex) {
所以他们告诉我这个错误:
constructor Service.Service(Integer) is not applicable
(actual argument String cannot be converted to Integer by method invocation conversion)
我该如何解决这个问题?
谢谢你