title: Return generic class type
body: <p>I have a method that might return Class A or Class B. How can I define its return type to be generic, independent of what class type is returned. For e.g.</p>
  
  <pre><code>public &lt;Generic_Class_Return_Type&gt; showForm() {
     if (true)
        return new ClassA();
     else 
        return new ClassB();
  }
  </code></pre>