Is it possible to specify both upper and lower bound constraints on type parameters in Java?

Posted by Hosam Aly on Stack Overflow See other posts from Stack Overflow or by Hosam Aly
Published on 2010-03-27T19:05:22Z Indexed on 2010/03/27 19:13 UTC
Read the original article Hit count: 507

Filed under:
|

Is it possible to specify both upper and lower bound constraints on type parameters in Java?

I found a conversation in Sun's forum in which this issue was discussed (apparently before the generics feature was finalized), but there was no final answer.

In summary, is there a valid syntax to do this:

public class MyClass<T extends Number super Integer>

?

© Stack Overflow or respective owner

Related posts about java

Related posts about generics