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

# 16.2.4. Local Variable Declaration Statements

- V is [un]assigned after a local variable declaration statement ([§14.4.2](14.4.2.md)) that contains no variable initializers iff V is [un]assigned before the local variable declaration statement.
- V is definitely assigned after a local variable declaration statement that contains at least one variable initializer iff either V is definitely assigned after the last variable initializer in the local variable declaration statement or the last variable initializer in the declaration is in the declarator that declares V.
- V is definitely unassigned after a local variable declaration statement that contains at least one variable initializer iff V is definitely unassigned after the last variable initializer in the local variable declaration statement and the last variable initializer in the declaration is not in the declarator that declares V.
- V is [un]assigned before the first variable initializer in a local variable declaration statement iff V is [un]assigned before the local variable declaration statement.
- V is definitely assigned before any variable initializer `e` other than the first one in the local variable declaration statement iff either V is definitely assigned after the variable initializer to the left of `e` or the initializer expression to the left of `e` is in the declarator that declares V.
- V is definitely unassigned before any variable initializer `e` other than the first one in the local variable declaration statement iff V is definitely unassigned after the variable initializer to the left of `e` and the initializer expression to the left of `e` is not in the declarator that declares V.
