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.

4.5.1 Type Arguments and Wildcards TYPES, VALUES, AND VARIABLES<br />

54<br />

throws type. In the absence of such interdependency, generic methods are considered bad<br />

style, and wildcards are preferred.<br />

Unlike ordinary type variables declared in a method signature, no type inference<br />

is required when using a wildcard. Consequently, it is permissible to declare<br />

lower bounds on a wildcard, using the syntax:<br />

? super B<br />

, where B is a lower bound.<br />

DISCUSSION<br />

Example: Lower bounds on wildcards.<br />

Reference(T referent, ReferenceQueue

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

Saved successfully!

Ooh no, something went wrong!