title: Is it possible in Java to have a constructor return another instance of the class, rather than constructing/returning itself?
body: <p>Is it possible in Java to have a constructor return <em>another</em> instance of the class, rather than constructing/returning itself?</p>
  
  <p>Kinda like</p>
  
  <pre><code>public class Container {
      private static Container cachedContainer = new Container(5,false);
      private int number;
      public Container(int number, boolean check) {
          if (number == 5 &amp;&amp; check) {
              return cachedContainer;   // &lt;-- This wouldn't work
          }
          this.number = number;
      }
  }
  </code></pre>
  
  <p>In that example, if you create an object containing the number 5 (and use the "check" flag), it will "interrupt" the construction and instead give you a preexisting object that already contains 5. Any other number won't cause such interruption.</p>