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.

CHAPTER14<br />

Blocks and Statements<br />

He was not merely a chip of the old block, but the old block itself.<br />

On Pitt’s First Speech<br />

THE sequence of execution of a program is controlled by statements, which are<br />

executed for their effect and do not have values.<br />

Some statements contain other statements as part of their structure; such other<br />

statements are substatements of the statement. We say that statement S<br />

immediately contains statement U if there is no statement T different from S and U<br />

such that S contains T and T contains U. In the same manner, some statements<br />

contain expressions (§15) as part of their structure.<br />

<strong>The</strong> first section of this chapter discusses the distinction between normal and<br />

abrupt completion of statements (§14.1). Most of the remaining sections explain<br />

the various kinds of statements, describing in detail both their normal behavior<br />

and any special treatment of abrupt completion.<br />

Blocks are explained first (§14.2), followed by local class declarations (§14.3)<br />

and local variable declaration statements (§14.4).<br />

Next a grammatical maneuver that sidesteps the familiar “dangling else”<br />

problem (§14.5) is explained.<br />

<strong>The</strong> last section (§14.21) of this chapter addresses the requirement that every<br />

statement be reachable in a certain technical sense.<br />

DRAFT<br />

359

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

Saved successfully!

Ooh no, something went wrong!