title: AtomicInteger and volatile
body: <p>I know <code>volatile</code> allows for visibility, <code>AtomicInteger</code> allows for atomicity.
  So if I use a volatile <code>AtomicInteger</code>, does it mean I don't have to use any more synchronization mechanisms?</p>
  
  <p>Eg. </p>
  
  <pre><code>class A {
  
      private volatile AtomicInteger count;
  
      void someMethod(){
          // do something
          if(count.get() &lt; 10) {
              count.incrementAndGet();
          }
  }
  </code></pre>
  
  <p>Is this threadsafe?</p>