Java AtomicLong set() Method

The set() method of java AtomicLong class sets the value of an AtomicLong instance.

Syntax

Parameters

newValue - The new value.

Example 1

Test it Now

Output:

5

Example 2

Test it Now

Output:

5

Example 3

Test it Now

Output:

-20

Next TopicJava AtomicLong




Latest Courses