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

# 16.9. Definite Assignment, Constructors, and Instance Initializers

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

- V is definitely assigned before an instance 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 an instance variable initializer. We can informally conclude that V is not definitely unassigned before any instance 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 `final` non-`static` member field of C, declared in C. Then:

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

The following rules hold within the constructors ([§8.8.7](8.8.7.md)) of class C:

- V is definitely assigned (and moreover is not definitely unassigned) after an alternate constructor invocation ([§8.8.7.1](8.8.7.1.md)).
- V is definitely unassigned (and moreover is not definitely assigned) before an explicit or implicit superclass constructor invocation ([§8.8.7.1](8.8.7.1.md)).
- If C has no instance initializers or instance variable initializers, then V is not definitely assigned (and moreover is definitely unassigned) after an explicit or implicit superclass constructor invocation.
- If C has at least one instance initializer or instance variable initializer then V is [un]assigned after an explicit or implicit superclass constructor invocation iff V is [un]assigned after the rightmost instance initializer or instance variable initializer of C.

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

- V is definitely assigned (and moreover is not definitely unassigned) before the block that is the body of a constructor or instance initializer of C.
- V is definitely assigned (and moreover is not definitely unassigned) before every instance variable initializer of C.
