atq

导航

 

integer是final,不可变的,所以也无法实现引用传递的功能。

解决方案

  1. int[]
  2. 做一个包装类
  3. org.apache.commons.lang.mutable.MutableInt
  4. java.util.concurrent.atomic.AtomicInteger
  5. 可以利用泛型TwoTuple返回多个值,通过返回值解决
posted on 2023-02-24 17:49  atq  阅读(103)  评论(0)    收藏  举报