项目中遇到读取Excel文件里面的数据转为金额的情况,为了程序更加的健壮,进行处理如下: import java.math.BigDecimal; import java.math.BigInteger; public class MathUtils { public static BigDecimal getBigDecimal( Object value ) { BigDecimal ret = null; if( value != null ) { if( value instanceof
List<Object> list = getList(); return (List<Customer>) list; Compiler says: cannot cast List<Object> to List<Customer> 不能将Object集合强制转换成实体集合! you can always cast any object to any type by up-casting it to Object first. in your cas