title: How to replace the Object in the "new" Operation?
body: <pre><code>class A {}
  
  class B extends A {}
  </code></pre>
  
  <p>now in some function:</p>
  
  <pre><code>A a = new A();
  </code></pre>
  
  <p>I want this result is replaced into a B object without changing my code.How can I do it?</p>