One fixed-arity member method named m is more specific than another member method of the same name and arity if all of the following conditions hold:
The declared types of the parameters of the first member method are T1, ..., Tn.
The declared types of the parameters of the other method are U1, ..., Un.
If the second method is generic, then let R1 ... Rp (p ≥ 1) be its type parameters, let Bl be the declared bound of Rl (1 ≤ l ≤ p), let A1 ... Ap be the type arguments inferred (§15.12.2.7) for this invocation under the initial constraints Ti << Ui (1 ≤ i ≤ n), and let Si = Ui[R1=A1,...,Rp=Ap] (1 ≤ i ≤ n).
Otherwise, let Si = Ui (1 ≤ i ≤ n).
For all j from 1 to n, Tj <: Sj.
If the second method is a generic method as described above, then Al <: Bl[R1=A1,...,Rp=Ap] (1 ≤ l ≤ p).
Campbell Ritchie wrote:Smaller than means subtype. You are going to have to read lots of the JLS to find out where.
Ranjith Suranga wrote:Hi... I have just read this section in JLS... about "Choosing the Most Specific Method"
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
The supertypes of a type are obtained by reflexive and transitive closure over the direct supertype relation, written S >1 T, which is defined by rules given later in this section.
Campbell Ritchie wrote:Does that really say an int is a subtype of a long? Good grief, that is miles out. Ignore that book.
Campbell Ritchie wrote:Does that really say an int is a subtype of a long? Good grief, that is miles out. Ignore that book.
The following rules define the direct supertype relation among the primitive types:
double >1 float
float >1 long
long >1 int
int >1 char
int >1 short
short >1 byte
Ranjith Suranga wrote:am I right... ?
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
This cake looks terrible, but it tastes great! Now take a bite out of this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|