title: Question about return type( need to return instances of different classes) in generics
body: <p>So my current code looks like this. The idea is to take in an instance of different classes using generic type T and return those instances.</p>
  
  <p>I should be able to call instances of classes like this</p>
  
  <pre><code>new A().add(new B())
  </code></pre>
  
  <pre><code>    public static &lt;T&gt; T &lt;T&gt; add(T t) {
          return new T();
      }
  </code></pre>
  
  <p>Basically to me the return type should be the class itself so that it can take a new instance through the return type.</p>
  
  <p>Can someone guide me as to where my logic is going wrong?</p>