Code example for AtomicInteger

Methods: getAndIncrement

0
 
  /** . */ 
  private final int serial;
 
  public Bean() { 
    this.serial = sequence.getAndIncrement();
  } 
 
  public int getSerial() { 
    return serial;
  } 
}