oop - Java Bound Mismatch in recursive generics/inheritance -


i have following structure:

public abstract class <e extends el, u extends a<e,u> > { ... }

public class b<e extends el> extends a<e, b<e> > { ... }

public abstract class c <e extends el, t extends a<e, t>> { ... }

my question is, why can this:

public class r extends c<el, b<el>> { ... }

but not

public class r <t extends b<el>> extends c<el, t> { ... }

why t (which extends b<el>) not substitute b<el>?

the exception bound mismatch: type t not valid substitute bounded parameter <t extends a<el,t>> of type c<e,t>

try declare a , c follows

public abstract class <e extends el, u extends a<e, ? super u>> {} public abstract class c <e extends el, t extends a<e, ? super t>> {} 

Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -