Java AtomicInteger toString() method

The toString() method of Java AtomicInteger class returns the String representation of the current value.

Syntax

Return

This method returns the String representation of the current value.

Example 1

Test it Now

Output:

the  new value is:1

Example 2

Test it Now

Output:

the  new value is: 100

Example 3

Test it Now

Output:

the  new value is: 34

Example 4

Test it Now

Output:

the  new value is: -10

Example 5

Test it Now

Output:

the  new value is: 0





Latest Courses