---
spec: JLS
title: "The Java Language Specification"
edition: "Java SE 13 Edition"
java_version: 13
chapter: "Chapter 14. Blocks and Statements"
section: "14"
heading: "Chapter 14. Blocks and Statements"
source: https://docs.oracle.com/javase/specs/jls/se13/html/jls-14.html
id: "14"
url: https://jvm.obfuscated.software/jls/se13/14.html
raw: https://jvm.obfuscated.software/jls/se13/14.md
---

# Chapter 14. Blocks and Statements

The sequence of execution of a program is controlled by *statements*, which are executed for their effect and do not have values.

Some statements *contain* other statements as part of their structure; such other statements are substatements of the statement. We say that statement `S` *immediately contains* statement `U` if there is no statement `T` different from `S` and `U` such that `S` contains `T` and `T` contains `U`. In the same manner, some statements contain expressions ([§15 (*Expressions*)](15.md)) as part of their structure.

The first section of this chapter discusses the distinction between normal and abrupt completion of statements ([§14.1](14.1.md)). Most of the remaining sections explain the various kinds of statements, describing in detail both their normal behavior and any special treatment of abrupt completion.

Blocks are explained first ([§14.2](14.2.md)), followed by local class declarations ([§14.3](14.3.md)) and local variable declaration statements ([§14.4](14.4.md)).

Next a grammatical maneuver that sidesteps the familiar "dangling else" problem ([§14.5](14.5.md)) is explained.

The last section ([§14.21](14.21.md)) of this chapter addresses the requirement that every statement be *reachable* in a certain technical sense.

**Sections:**

- [14.1. Normal and Abrupt Completion of Statements](14.1.md)
- [14.2. Blocks](14.2.md)
- [14.3. Local Class Declarations](14.3.md)
- [14.4. Local Variable Declaration Statements](14.4.md)
- [14.5. Statements](14.5.md)
- [14.6. The Empty Statement](14.6.md)
- [14.7. Labeled Statements](14.7.md)
- [14.8. Expression Statements](14.8.md)
- [14.9. The if Statement](14.9.md)
- [14.10. The assert Statement](14.10.md)
- [14.11. The switch Statement](14.11.md)
- [14.12. The while Statement](14.12.md)
- [14.13. The do Statement](14.13.md)
- [14.14. The for Statement](14.14.md)
- [14.15. The break Statement](14.15.md)
- [14.16. The continue Statement](14.16.md)
- [14.17. The return Statement](14.17.md)
- [14.18. The throw Statement](14.18.md)
- [14.19. The synchronized Statement](14.19.md)
- [14.20. The try statement](14.20.md)
- [14.21. Unreachable Statements](14.21.md)
