title: Using volatile keyword with mutable object
body: <p>In Java, I understand that <code>volatile</code> keyword provides visibility to variables. The question is, if a variable is a reference to a mutable object, does <code>volatile</code> also provide visibility to the members inside that object?</p>
  <p>In the example below, does it work correctly if multiple threads are accessing <code>volatile Mutable m</code> and changing the <code>value</code>?</p>
  <p>example</p>
  <pre><code>class Mutable {
      private int value;
      public int get()
      {
          return a;
      }
      public int set(int value)
      {
          this.value = value;
      }
  }
  
  class Test {
      public volatile Mutable m;
  }
  </code></pre>