java.math.BigInteger cannot be cast to java.lang.Integer

后端 未结 5 1850
予麋鹿
予麋鹿 2020-12-13 09:48

I\'m getting the following exception.

Caused by:

java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Integer

5条回答
  •  星月不相逢
    2020-12-13 10:32

    You can try this:

    ((BigDecimal) volume).intValue();
    

    I use java.math.BigDecimal convert to int (primitive type).

    It is worked for me.

提交回复
热议问题