Cannot cast java.lang.Long to java.lang.Integer

Administrator · · 111 阅读
Cannot cast java.lang.Long to java.lang.Integer

Cannot cast java.lang.Long to java.lang.Integer

if (type.equals(Integer.class)) {
     Integer result =  new Integer( Math.toIntExact((Long) o)); // o 是 Long类型的实例
 }

评论