Object obj= map.get(“startNo”);
int startNo= Integer.parseInt(String.valueOf(obj));
强制类型转换会报错
如
int startNo = new Integer((String)obj);
int startNo = ((Long)obj).intValue();
Object转int报错,解决
最新推荐文章于 2024-07-09 16:19:00 发布
Object obj= map.get(“startNo”);
int startNo= Integer.parseInt(String.valueOf(obj));
强制类型转换会报错
如
int startNo = new Integer((String)obj);
int startNo = ((Long)obj).intValue();