title: Java Singleton Pattern
body: <p>Edit: Answered - error was method wasn't static</p>
  
  <p>I'm used the <a href="http://en.wikipedia.org/wiki/Singleton_pattern" rel="noreferrer">Singleton Design Pattern</a></p>
  
  <pre><code> public class Singleton {
     private static final Singleton INSTANCE = new Singleton();
  
     // Private constructor prevents instantiation from other classes
     private Singleton() {}
  
     public static Singleton getInstance() {
        return INSTANCE;
     }
   }
  </code></pre>
  
  <p>My question is how do I create an object of class Singleton in <strong>another</strong> class?</p>
  
  <p>I've tried:</p>
  
  <pre><code>Singleton singleton = new Singleton(); 
  // error - constructor is private
  Singleton singleton = Singleton.getInstance();
  // error - non-static method cannot be referenced from a static context
  </code></pre>
  
  <p>What is the correct code?</p>
  
  <p>Thanks,
  Spencer</p>