Java AtomicInteger set() 方法

2025年3月20日 | 阅读时长1分钟

Java AtomicInteger 的 set() 方法将 atomicinteger 的值设置为给定值。

语法

参数

这是新值。

返回

它不返回任何值。

示例 1

输出

the  new value is:100

示例 2

输出

the  new value is:1

示例 3

输出

the  new value is:10

示例 4

输出

the  new value is:0

示例 5

输出

the  new value is:-10
 
下一主题Java AtomicInteger