E
E11
Hi,
In section 4.5 of the Java Language Specification, there is such a
paragraph:
There are a few things that i don't quite understand.
1. What is the meaning of "Xi <: Bi[A1 := X1, ..., An := Xn]"? i know
that Xi <: Bi means that Xi is a sub-class of Bi, but what does it mean
to have all that stuff in square parentheses after Bi?
2. What is capture conversion? It is explained in §5.1.10, but i don't
quite understand the explanation. Anyone able to do it in more layman
terms?
Thanks in Advance,
Edwin
In section 4.5 of the Java Language Specification, there is such a
paragraph:
A parameterized type consists of a class or interface name C and an
actual type argument list <T1 , ... , Tn>. It is a compile time error
if C is not the name of a generic class or interface, or if the number
of type arguments in the actual type argument list differs from the
number of declared type parameters of C. In the following, whenever we
speak of a class or interface type, we include the generic version as
well, unless explicitly excluded. Throughout this section, let A1 , ...
, An be the formal type parameters of C, and let be Bi be the declared
bound of Ai. The notation [Ai := Ti] denotes substitution of the type
variable Ai with the type Ti, for 1=i=n, and is used throughout
this specification.
Let P = G<T1, ..., Tn> be a parameterized type. It must be the case
that, after P is subjected to capture conversion (§5.1.10) resulting
in the type G<X1, ..., Xn>, for each actual type argument Xi,
1=i=n, Xi <: Bi[A1 := X1, ..., An := Xn] (§4.10), or a compile
time error occurs.
There are a few things that i don't quite understand.
1. What is the meaning of "Xi <: Bi[A1 := X1, ..., An := Xn]"? i know
that Xi <: Bi means that Xi is a sub-class of Bi, but what does it mean
to have all that stuff in square parentheses after Bi?
2. What is capture conversion? It is explained in §5.1.10, but i don't
quite understand the explanation. Anyone able to do it in more layman
terms?
Thanks in Advance,
Edwin