---
spec: JVMS
title: "The Java Virtual Machine Specification"
edition: "Java SE 8 Edition"
java_version: 8
chapter: "Chapter 5. Loading, Linking, and Initializing"
section: "5.4.2"
heading: "5.4.2. Preparation"
parent: "5.4. Linking"
source: https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-5.html#jvms-5.4.2
id: "5.4.2"
url: https://jvm.obfuscated.software/jvms/se8/5.4.2.html
raw: https://jvm.obfuscated.software/jvms/se8/5.4.2.md
---

# 5.4.2. Preparation

*Preparation* involves creating the static fields for a class or interface and initializing such fields to their default values ([§2.3](2.3.md), [§2.4](2.4.md)). This does not require the execution of any Java Virtual Machine code; explicit initializers for static fields are executed as part of initialization ([§5.5](5.5.md)), not preparation.

During preparation of a class or interface C, the Java Virtual Machine also imposes loading constraints ([§5.3.4](5.3.4.md)). Let `L_1` be the defining loader of C. For each method `m` declared in C that overrides ([§5.4.5](5.4.5.md)) a method declared in a superclass or superinterface `<`D, `L_2>`, the Java Virtual Machine imposes the following loading constraints:

Given that the return type of `m` is T_r, and that the formal parameter types of `m` are T_{f1}, ..., T_{fn}, then:

If T_r not an array type, let T_0 be T_r; otherwise, let T_0 be the element type ([§2.4](2.4.md)) of T_r.

For *i* = 1 to *n*: If T_{fi} is not an array type, let T_i be T_{fi}; otherwise, let T_i be the element type ([§2.4](2.4.md)) of T_{fi}.

Then T_i^{L_1} = T_i^{L_2} for *i* = 0 to *n*.

Furthermore, if C implements a method `m` declared in a superinterface `<`I, `L_3>` of C, but C does not itself declare the method `m`, then let `<`D, `L_2>` be the superclass of C that declares the implementation of method `m` inherited by C. The Java Virtual Machine imposes the following constraints:

Given that the return type of `m` is T_r, and that the formal parameter types of `m` are T_{f1}, ..., T_{fn}, then:

If T_r not an array type, let T_0 be T_r; otherwise, let T_0 be the element type ([§2.4](2.4.md)) of T_r.

For *i* = 1 to *n*: If T_{fi} is not an array type, let T_i be T_{fi}; otherwise, let T_i be the element type ([§2.4](2.4.md)) of T_{fi}.

Then T_i^{L_2} = T_i^{L_3} for *i* = 0 to *n*.

Preparation may occur at any time following creation but must be completed prior to initialization.
