int 强制类型转换错误提示Cannot cast from Object to int
解决:把int 改为 Integer 来转换
eg: int stuId=(int) request.getSession().getAttribute(“stuid”); 改为 int stuId=(Integer) request.getSession().getAttribute(“stuid”);
int 强制类型转换错误提示Cannot cast from Object to int
最新推荐文章于 2023-03-02 13:43:50 发布
本文解析了Java中int强制类型转换为Integer的常见错误,并提供了解决方案,避免因类型不匹配导致的运行时异常。
1031

被折叠的 条评论
为什么被折叠?



