---
spec: JVMS
title: "The Java Virtual Machine Specification"
edition: "Java SE 18 Edition"
java_version: 18
chapter: "Chapter 5. Loading, Linking, and Initializing"
section: "5.3.3"
heading: "5.3.3. Creating Array Classes"
parent: "5.3. Creation and Loading"
source: https://docs.oracle.com/javase/specs/jvms/se18/html/jvms-5.html#jvms-5.3.3
id: "5.3.3"
url: https://jvm.obfuscated.software/jvms/se18/5.3.3.html
raw: https://jvm.obfuscated.software/jvms/se18/5.3.3.md
---

# 5.3.3. Creating Array Classes

The following steps are used to create the array class C denoted by the name `N` in association with the class loader `L`. `L` may be either the bootstrap class loader or a user-defined class loader.

First, the Java Virtual Machine determines whether `L` has already been recorded as an initiating loader of an array class with the same component type as `N`. If so, this class is C, and no array class creation is necessary.

Otherwise, the following steps are performed to create C:

1. If the component type is a `reference` type, the algorithm of this section ([§5.3](5.3.md)) is applied recursively using `L` in order to load and thereby create the component type of C.

2. The Java Virtual Machine creates a new array class with the indicated component type and number of dimensions.

   If the component type is a `reference` type, the Java Virtual Machine marks C to have the defining loader of the component type as its defining loader. Otherwise, the Java Virtual Machine marks C to have the bootstrap class loader as its defining loader.

   In any case, the Java Virtual Machine then records that `L` is an initiating loader for C ([§5.3.4](5.3.4.md)).

   If the component type is a `reference` type, the accessibility of the array class is determined by the accessibility of its component type ([§5.4.4](5.4.4.md)). Otherwise, the array class is accessible to all classes and interfaces.
