---
spec: JLS
title: "The Java Language Specification"
edition: "Java SE 10 Edition"
java_version: 10
chapter: "Chapter 16. Definite Assignment"
section: "16.8"
heading: "16.8. Definite Assignment and Static Initializers"
parent: "Chapter 16. Definite Assignment"
source: https://docs.oracle.com/javase/specs/jls/se10/html/jls-16.html#jls-16.8
id: "16.8"
url: https://jvm.obfuscated.software/jls/se10/16.8.html
raw: https://jvm.obfuscated.software/jls/se10/16.8.md
---

# 16.8. Definite Assignment and Static Initializers

Let C be a class declared within the scope of V. Then:

- V is definitely assigned before an enum constant ([§8.9.1](8.9.1.md)) or static variable initializer ([§8.3.2](8.3.2.md)) of C iff V is definitely assigned before the declaration of C.

  Note that there are no rules that would allow us to conclude that V is definitely unassigned before a static variable initializer or enum constant. We can informally conclude that V is not definitely unassigned before any static variable initializer of C, but there is no need for such a rule to be stated explicitly.

Let C be a class, and let V be a blank `static` `final` member field of C, declared in C. Then:

- V is definitely unassigned (and moreover is not definitely assigned) before the leftmost enum constant, static initializer ([§8.7](8.7.md)), or static variable initializer of C.
- V is [un]assigned before an enum constant, static initializer, or static variable initializer of C other than the leftmost iff V is [un]assigned after the preceding enum constant, static initializer, or static variable initializer of C.

Let C be a class, and let V be a blank `static` `final` member field of C, declared in a superclass of C. Then:

- V is definitely assigned (and moreover is not definitely unassigned) before every enum constant of C.
- V is definitely assigned (and moreover is not definitely unassigned) before the block that is the body of a static initializer of C.
- V is definitely assigned (and moreover is not definitely unassigned) before every static variable initializer of C.
