Java tutorial says that <?> and <T> are interchangeable. Why then can I compile line 1 below, while I cannot compile line [2]?
abstract class A<K extends Number>{
abstract public A<?> f(A<?> k); //[1]
abstract public <S> A<S> f(A<S> k); //[2]
}
After many hours of reading and searching, I have eventually found the answer to my own question.
First of all, I have to say about
<?>, there is some information here.Ok, so our

A<?>is super type of all kinds of As.And parametr
A<?>can accept any of As (polymorphically) as a argument therefore line 1 compiles.Java specification tells us:
B stands for bounds;
X<:Bindicates that the subtype relation holds betweentypes X and B.
Therefore
A<?>is indeed auto-restricted;When we declare type argument
<S>, it is, in some way, as if we declaredclass S{}, type S don’t have any relations to Number(our bound) and cast to one would fail, so we should declare that “S extends Number” to have the same effect as for<?>.