---
spec: JVMS
title: "The Java Virtual Machine Specification"
edition: "Java SE 23 Edition"
java_version: 23
chapter: "Chapter 6. The Java Virtual Machine Instruction Set"
section: "6.5.aastore"
heading: "aastore"
parent: "6.5. Instructions"
source: https://docs.oracle.com/javase/specs/jvms/se23/html/jvms-6.html#jvms-6.5.aastore
id: "6.5.aastore"
url: https://jvm.obfuscated.software/jvms/se23/6.5.aastore.html
raw: https://jvm.obfuscated.software/jvms/se23/6.5.aastore.md
---

# aastore

## Operation

Store into `reference` array

## Format

```
aastore
```

## Forms

*aastore* = 83 (0x53)

## Operand Stack

..., *arrayref*, *index*, *value* →

...

## Description

The *arrayref* must be of type `reference` and must refer to an array whose components are of type `reference`. The *index* must be of type `int`, and *value* must be of type `reference`. The *arrayref*, *index*, and *value* are popped from the operand stack.

If *value* is `null`, then *value* is stored as the component of the array at *index*.

Otherwise, *value* is non-`null`. If *value* is a value of the component type of the array referenced by *arrayref*, then *value* is stored as the component of the array at *index*.

Whether *value* is a value of the array component type is determined according to the rules given for [§*checkcast*](6.5.checkcast.md).

## Run-time Exceptions

If *arrayref* is `null`, *aastore* throws a `NullPointerException`.

Otherwise, if *index* is not within the bounds of the array referenced by *arrayref*, the *aastore* instruction throws an `ArrayIndexOutOfBoundsException`.

Otherwise, if the non-`null` *value* is not a value of the array component type, *aastore* throws an `ArrayStoreException`.
