---
spec: JLS
title: "The Java Language Specification"
edition: "Java SE 23 Edition"
java_version: 23
chapter: "Chapter 16. Definite Assignment"
section: "16.2.10"
heading: "16.2.10. while Statements"
parent: "16.2. Definite Assignment and Statements"
source: https://docs.oracle.com/javase/specs/jls/se23/html/jls-16.html#jls-16.2.10
id: "16.2.10"
url: https://jvm.obfuscated.software/jls/se23/16.2.10.html
raw: https://jvm.obfuscated.software/jls/se23/16.2.10.md
---

# 16.2.10. `while` Statements

- V is [un]assigned after `while (e) S` ([§14.12](14.12.md)) iff V is [un]assigned after `e` when false and V is [un]assigned before every `break` statement for which the `while` statement is the break target.

- V is definitely assigned before `e` iff V is definitely assigned before the `while` statement.

- V is definitely unassigned before `e` iff all of the following are true:

  - V is definitely unassigned before the `while` statement.
  - Assuming V is definitely unassigned before `e`, V is definitely unassigned after S.
  - Assuming V is definitely unassigned before `e`, V is definitely unassigned before every `continue` statement for which the `while` statement is the continue target.

- V is [un]assigned before S iff V is [un]assigned after `e` when true.
