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

# castore

## Operation

Store into `char` array

## Format

```
castore
```

## Forms

*castore* = 85 (0x55)

## Operand Stack

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

...

## Description

The *arrayref* must be of type `reference` and must refer to an array whose components are of type `char`. The *index* and the *value* must both be of type `int`. The *arrayref*, *index*, and *value* are popped from the operand stack. The `int` *value* is truncated to a `char` and stored as the component of the array indexed by *index*.

## Run-time Exceptions

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

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