Java: is there no AtomicFloat or AtomicDouble?

后端 未结 8 1442
误落风尘
误落风尘 2020-12-01 03:12

I have found AtomicInteger, AtomicLong, but where is AtomicFloat (or AtomicDouble)? Maybe there is some trick?

8条回答
  •  眼角桃花
    2020-12-01 04:05

    You could perhaps use an AtomicReference instead. I think AtomicInteger and AtomicLong get special classes because they're useful for counting.

提交回复
热议问题