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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

TYPES, VALUES, AND VARIABLES Type Variables 4.4<br />

<strong>The</strong> string concatenation operator + (§15.18.1) implicitly creates a new<br />

String object when the result is not a compile-time constant (§15.28).<br />

4.3.4 When Reference Types Are the Same<br />

Two reference types are the same compile-time type if they have the same binary<br />

name (§13.1) and their type parameters, if any, are the same, applying this definition<br />

recursively. When two reference types are the same, they are sometimes said<br />

to be the same class or the same interface.<br />

At run time, several reference types with the same binary name may be loaded<br />

simultaneously by different class loaders. <strong>The</strong>se types may or may not represent<br />

the same type declaration. Even if two such types do represent the same type declaration,<br />

they are considered distinct.<br />

Two reference types are the same run-time type if:<br />

• <strong>The</strong>y are both class or both interface types, are defined by the same class<br />

loader, and have the same binary name (§13.1), in which case they are sometimes<br />

said to be the same run-time class or the same run-time interface.<br />

• <strong>The</strong>y are both array types, and their component types are the same run-time<br />

type(§10).<br />

4.4 Type Variables<br />

A type variable (§4.4) is an unqualified identifier. Type variables are introduced<br />

by generic class declarations (§8.1.2) generic interface declarations (§9.1.2)<br />

generic method declarations (§8.4.4) and by generic constructor declarations<br />

(§8.8.4).<br />

TypeParameter:<br />

TypeVariable TypeBoundopt TypeBound:<br />

DRAFT<br />

extends ClassOrInterfaceType AdditionalBoundList opt<br />

AdditionalBoundList:<br />

AdditionalBound AdditionalBoundList<br />

AdditionalBound<br />

AdditionalBound:<br />

& InterfaceType<br />

49

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

Saved successfully!

Ooh no, something went wrong!