10.12.2012 Views

The Java Language Specification, Third Edition

The Java Language Specification, Third Edition

The Java Language Specification, Third Edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.10.3 Subtyping among Array Types TYPES, VALUES, AND VARIABLES<br />

64<br />

• <strong>The</strong> type Object, if C is an interface type with no direct superinterfaces.<br />

• <strong>The</strong> raw type C.<br />

<strong>The</strong> direct supertypes of the type C , where Ti, 1 ≤i≤n, is a<br />

type, are D, where<br />

• D is a direct supertype of C, and theta is the substitution<br />

[F1 := T1, ..., Fn := Tn]. • C where Si contains (§4.5.1.1) Ti for 1 ≤i≤n. <strong>The</strong> direct supertypes of the type C , where at least one of the Ri, 1 ≤i≤n, is a wildcard type argument, are the direct supertypes of C, where<br />

C is the result of applying capture conversion (§5.1.10) to<br />

C. <strong>The</strong> direct supertypes of an intersection type (§4.9) T1 & ... & Tn, are Ti, 1 ≤i≤n. <strong>The</strong> direct supertypes of a type variable (§4.4) are the types listed in its bound.<br />

<strong>The</strong> direct supertypes of the null type are all reference types other than the<br />

null type itself.<br />

In addition to the above rules, a type variable is a direct supertype of its lower<br />

bound.<br />

4.10.3 Subtyping among Array Types<br />

<strong>The</strong> following rules define the direct subtype relation among array types:<br />

• If S and T are both reference types, then S[] > 1 T[] iff S > 1 T.<br />

• Object > 1 Object[]<br />

DRAFT<br />

• Cloneable > 1 Object[]<br />

• java.io.Serializable >1 Object[]<br />

• If p is a primitive type, then:<br />

◆ Object >1 p[]<br />

◆ Cloneable >1 p[]<br />

◆ java.io.Serializable >1 p[]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!