Java Terminology
<p>I am new to Java and would like to know a bit more.  I have a current problem that I would like an answer to but I would also like to know what the technique is referred to as so that I can do some further reading.</p>

<p>I currently have something like this</p>

<pre><code>public class BasicActivityExtension
{
public Boolean basicExtensionMethod(){}
...}

pubic class MyExtension extends BasicActivityExtension
{public Boolean myExtensionMethod(){}...}
</code></pre>

<p>Then in a service method I have (ignore the ( i couldnt work out how to get the &lt; to stay in this)</p>

<pre><code>public Class &lt; ? extends BasicActivityExtension&gt; getExtensionByActivity(BasicActivity     activity,
        ExtensionTypes type) throws Exception {
....
}
</code></pre>

<p><strong>My Question is why does this give an error and what is the name for this technique (when done correctly!)</strong></p>

<pre><code>MyExtension members = (MyExtension) activityService.getExtensionByActivity(activity,         ExtensionTypes.member);
</code></pre>

<p>The error is 
Cannot cast from Class to MyExtension;</p>

<p>Also if I have an object Class&lt; ? extends BasicActivityExtension> how can I just call the generic methods in BasicActivityExtension without caring what class it is?</p>

<p>Cheers,</p>

<p>Rob</p>
