CompanyDAO companyDAO = new CompanyDAO();
List companyList = companyDAO.getAllCompanyList();
MycompanyList 包含类似以下的数据:
[[1, Agastha Medical Center], [2, Agastha Asthma]]
现在我想遍历这些值,并且想要将一个值1传递给查询,但是当我将其放置在for循环内部时,我得到了一个错误。
for(int k=0;k<=companyList.size();k++){
List companyId =companyList.get(k); // [1, Agastha Medical Center] for k=0;
Type mismatch: cannot convert from Object to List
我需要在for循环中读取1的值,我应该怎么做?
List
,而应该使用类型化的List<Company>
。 - Subhrajyoti Majumder