title: How does thread interference actually happens in the `Counter` example class?
body: <p>I'm trying to learn the concept of thread interference and have encountered the following example in Java Tutorial Oracle:</p>
  
  <pre><code>class Counter {
      private int c = 0;
  
      public void increment() {
          c++;
      }
  
      public void decrement() {
          c--;
      }
  
      public int value() {
          return c;
      }
  
  }
  </code></pre>
  
  <p>The Oracle tutorial mentioned that if there are two threads trying access variable <code>c</code>, it can result in thread interference where the change made by one thread is not seen by the other.</p>
  
  <p>However, it did not provide any code to actually explain the concept. Could someone please provide a code example based the <code>Counter</code> class to demonstrate how thread interference actually happens?</p>