The operator > is undefined for the argument type(s) String, int
用arraylist存了数组,如何用get()提取出来?privatevoidshowInventory(){Iterator<GoodsInfo>iterator=go...
用arraylist存了数组,如何用get()提取出来?
private void showInventory() {
Iterator<GoodsInfo> iterator=goodsList.values().iterator();
......
}
System.out.print(goodsinfo.getGoodsPrice()+"\t");
System.out.println(goodsinfo.getGoodsInventory()+"\t");
goodsnum.add(goodsinfo.getGoodsNum());
goodsname.add(goodsinfo.getGoodsName());
goodsprice.add(goodsinfo.getGoodsPrice());
goodsinventory.add(goodsinfo.getGoodsInventory());
}
} 展开
private void showInventory() {
Iterator<GoodsInfo> iterator=goodsList.values().iterator();
......
}
System.out.print(goodsinfo.getGoodsPrice()+"\t");
System.out.println(goodsinfo.getGoodsInventory()+"\t");
goodsnum.add(goodsinfo.getGoodsNum());
goodsname.add(goodsinfo.getGoodsName());
goodsprice.add(goodsinfo.getGoodsPrice());
goodsinventory.add(goodsinfo.getGoodsInventory());
}
} 展开
1个回答
展开全部
那个readLine()返回的是一个字符串吧, 不是int类型.
试一试, int i = Integer.parseInt(num);
参考:https://zhidao.baidu.com/question/144544532.html
试一试, int i = Integer.parseInt(num);
参考:https://zhidao.baidu.com/question/144544532.html
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询