title: Right way to access Java Singleton private members
body: <p>If you have a Java Singleton that looks like this:</p>
  
  <pre><code>public class MySingleton {
  
  private static MySingleton instance;
  
  private int member;
  
  public static MySingleton getInstance(){
      if(instance==null){
          instance = new MySingleton();
      }
      return instance;
  }
  
  private MySingleton(){
      //empty private constructor
  }
  
  public int getMemberA(){
      return member;
  }
  
  public int getMemberB(){
      return instance.member;
  }
  
  }
  </code></pre>
  
  <p>...is there a difference between getMemberA and getMemberB? That is, is there a difference between accessing the member with <code>instance.xxx</code> and just <code>xxx</code>?</p>
  
  <p>Note: I am aware of the pros and cons of using the Singleton pattern!</p>