title: Return value of assignment operator in concurrent code
body: <p>Given the following class:</p>
  
  <pre><code>class Foo {
    public volatile int number;
  
    public int method1() {
      int ret = number = 1;
      return ret;
    }
  
    public int method2() {
      int ret = number = 2;
      return ret;
    }
  }
  </code></pre>
  
  <p>and given multiple threads calling <code>method1()</code> and <code>method2()</code> concurrently on the same <code>Foo</code> instance, can a call to method1() ever return anything other than 1?</p>