Type parameter as bound of another type parameter

Hi,

class MyClass<T>{

public <Uextends T & Comparable> MyClass<U> get(){}

}

If you use a type parameter as a bound of another type parameter,

then you can't use any other bounds on that parameter.

Is it because you could end up with a type which could inherit from

two classes ?

If the answer is yes, then I guess the compiler doesn't bother to check

whether all other bounds are ONLY interfaces, so it could allow to do so,

because the benefit would be to little and it could be bug-prone ?

Thanks,

Adrian

[815 byte] By [AdrianSosialuka] at [2007-11-27 5:43:12]
# 1
Can you give an example of how you might use this? I'm just trying to understand what meaning this would have.
dubwaia at 2007-7-12 15:22:34 > top of Java-index,Core,Core APIs...
# 2

Hi,

Yhhhhh, that was one of the question to sentence: "one of the

things you CAN'T do is ..." so I talked back and asked "why I can't

do that ?" :) I really don't know what benefit it would give - I don't

have any analytic experience. I was just wandering why it is

not allowed to do such thing ....

But I will have to thing about it anyway ;)

Thanks,

Adrian

AdrianSosialuka at 2007-7-12 15:22:34 > top of Java-index,Core,Core APIs...
# 3
Honestly, I'm not quite sure. I thought maybe if I knew what you were trying to do I might see a problem.
dubwaia at 2007-7-12 15:22:34 > top of Java-index,Core,Core APIs...