title: How does a static factory method return a new instance?
body: <p>I've been reading in various places that it's often advisable to use static factory methods over public constructors.</p>
  
  <p>One of the advantages is that unlike with constructors, a static factory method does not create a new object each time it is invoked. However, as I read on <a href="http://sourcemaking.com/refactoring/replace-constructor-with-factory-method" rel="nofollow">this site</a>, the factory method for the class </p>
  
  <pre><code>class Employee {
     private int _type;
     static final int ENGINEER = 0;
     static final int SALESMAN = 1;
     static final int MANAGER = 2;
  
     Employee (int type) {
         _type = type;
     }
  }
  </code></pre>
  
  <p>is defined as :</p>
  
  <pre><code>static Employee create(int type) {
       return new Employee(type);
   }
  </code></pre>
  
  <p>Thus to create a new instance, we do</p>
  
  <pre><code>Employee eng = Employee.create(Employee.ENGINEER);
  </code></pre>
  
  <p>What I don't understand is, isn't the factory method invoking the public constructor? So isn't it creating a new instance all over again?</p>
  
  <p>A second aspect of using static factory methods that I don't quite understand is why can classes without public / protected constructors not be subclassed?</p>