What wrong in this method declaration?
public abstract class A<K extends Number>{
public abstract <K> A<K> useMe (A<K> k);
}
I see compile error:
java: type argument K is not within bounds of type-variable K
my first thought for this compile error was that as - It is not guaranteed that K is Number in my method declaration, that's why issue is coming.
But in another case as below:
public abstract <K> A<? extends Number> useMe (A<? super K> k);
A<? super K>
is again not guaranteed that it is Number (However IDE sign warning) but it is not compile error.
What are the differences?