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.

NAMES Names and Identifiers 6.2<br />

❖ A constant field declared in an interface type (§9.3)<br />

❖ <strong>The</strong> field length, which is implicitly a member of every array type<br />

(§10.7)<br />

◆ A method, one of the following:<br />

❖ A method (abstract or otherwise) declared in a class type (§8.4)<br />

❖ A method (always abstract) declared in an interface type (§9.4)<br />

• A parameter, one of the following:<br />

◆ A parameter of a method or constructor of a class (§8.4.1, §8.8.1)<br />

◆ A parameter of an abstract method of an interface (§9.4)<br />

◆ A parameter of an exception handler declared in a catch clause of a try<br />

statement (§14.20)<br />

• A local variable, one of the following:<br />

◆ A local variable declared in a block (§14.4)<br />

◆ A local variable declared in a for statement (§14.14)<br />

Constructors (§8.8) are also introduced by declarations, but use the name of the<br />

class in which they are declared rather than introducing a new name.<br />

6.2 Names and Identifiers<br />

A name is used to refer to an entity declared in a program.<br />

<strong>The</strong>re are two forms of names: simple names and qualified names. A simple<br />

name is a single identifier. A qualified name consists of a name, a “.” token, and<br />

an identifier.<br />

In determining the meaning of a name (§6.5), the context in which the name<br />

appears is taken into account. <strong>The</strong> rules of §6.5 distinguish among contexts where<br />

a name must denote (refer to) a package (§6.5.3), a type (§6.5.5), a variable or<br />

value in an expression (§6.5.6), or a method (§6.5.7).<br />

Not all identifiers in programs are a part of a name. Identifiers are also used in<br />

the following situations:<br />

DRAFT<br />

115

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

Saved successfully!

Ooh no, something went wrong!