title: Java extending generics
body: <p>Is this possible?</p>
  
  <pre><code>class A&lt;T extends Service&lt;E extends Entity&gt;&gt;
  </code></pre>
  
  <p>It's because I want to get the type of Service and Entity. Or any other way around to do it? </p>
  
  <p>Currently I have an abstract method that sets the Service but if I can do it in parameter then much better.</p>
  
  <p>I'm also wondering how can I pass the parameters in a base class:</p>
  
  <p>I have ClassA that extends SubBaseClass1 that extends BaseClass1.</p>
  
  <p>So:</p>
  
  <pre><code>class SubBaseClass1&lt;E extends Entity, P extends Service&lt;E&gt;&gt; { }
  </code></pre>
  
  <p>In BaseClass, I want to know the type of P and E.</p>
  
  <p>Another question, if I have a method getBaseClass from another class, how will I specify the return type?:</p>
  
  <pre><code>public BaseClass&lt;E extends Entity, T extends Service&lt;E&gt;&gt; getBaseClass() { }
  </code></pre>
  
  <p>Is not working.</p>
  
  <p>Found the answer: </p>
  
  <pre><code>public BaseClass&lt;? extends IEntity, ? extends Service&lt;?&gt;&gt; getBaseClass() { }
  </code></pre>