Java API Tutorial - Java AtomicInteger.toString()








Syntax

AtomicInteger.toString() has the following syntax.

public String toString()

Example

In the following code shows how to use AtomicInteger.toString() method.

import java.util.concurrent.atomic.AtomicInteger;
//from   w  ww . j a  va  2s  . c o m
public class Main {
  public static void main(String[] argv) throws Exception {
    AtomicInteger atomicInteger = new AtomicInteger();
    
    
    System.out.println(atomicInteger.toString());
  }
}

The code above generates the following result.