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

前端 未结 8 725
醉话见心
醉话见心 2020-12-09 15:44

I\'ve got List dynamics. And I want to get max result using Collections. This is my code:

List dynamics=spy         


        
8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-09 16:06

    I'm lacking context, but this is working just fine:

    List nums = new ArrayList();
    Long max = Collections.max(nums).longValue(); // from BigInteger to Long...
    

提交回复
热议问题