title: Can we make a Singleton class by making private getInstance method and public getter setter methods?
body: <p>Doesn't Singleton class just means enforcing of presence of a single instance of a class always? If that is the case, unlike the norm, can't we have getter-setter methods in it with private getInstance method?
  In short, is below class an example of Singleton class? Why / Why not:-</p>
  
  <pre><code>public class MySingletonClass {
  private MySingletonClass mySingletonClass;
  private String name;
  private MySingletonClass(){
  
  }
  private MySingletonClass getSingletonClassReference(){
      if(mySingletonClass==null){
          mySingletonClass = new MySingletonClass();
      }
      return mySingletonClass;
  }
  
  public static String getName() {
      return getSingletonClassReference().name;
  }
  
  public static setName(String name) {
      getSingletonClassReference().name = name;
  }}
  </code></pre>
  
  <p><strong>EDIT</strong>
  Since above code gives compile time error, here is the modified class code. Question is still same, can't we have a public getter-setters and private getInstance method? Why not?</p>
  
  <pre><code>public class MySingletonClass {
  private static MySingletonClass mySingletonClass;
  private String name;
  private MySingletonClass(){
  
  }
  private static MySingletonClass getSingletonClassReference(){
      if(mySingletonClass==null){
          mySingletonClass = new MySingletonClass();
      }
      return mySingletonClass;
  }
  
  public static String getName() {
      return getSingletonClassReference().name;
  }
  
  public static void setName(String name) {
      getSingletonClassReference().name = name;
  }}
  </code></pre>