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

# ldc_w

## Operation

Push item from run-time constant pool (wide index)

## Format

```
ldc_w
indexbyte1
indexbyte2
```

## Forms

*ldc_w* = 19 (0x13)

## Operand Stack

... →

..., *value*

## Description

The unsigned *indexbyte1* and *indexbyte2* are assembled into an unsigned 16-bit index into the run-time constant pool of the current class ([§2.6](2.6.md)), where the value of the index is calculated as (*indexbyte1* `<<` 8) | *indexbyte2*. The index must be a valid index into the run-time constant pool of the current class. The run-time constant pool entry at the index either must be a run-time constant of type `int` or `float`, or a `reference` to a string literal, or a symbolic reference to a class, method type, or method handle ([§5.1](5.1.md)).

If the run-time constant pool entry is a run-time constant of type `int` or `float`, the numeric *value* of that run-time constant is pushed onto the operand stack as an `int` or `float`, respectively.

Otherwise, if the run-time constant pool entry is a `reference` to an instance of class `String` representing a string literal ([§5.1](5.1.md)), then a `reference` to that instance, *value*, is pushed onto the operand stack.

Otherwise, if the run-time constant pool entry is a symbolic reference to a class ([§4.4.1](4.4.1.md)). The named class is resolved ([§5.4.3.1](5.4.3.1.md)) and a `reference` to the `Class` object representing that class, *value*, is pushed onto the operand stack.

Otherwise, the run-time constant pool entry must be a symbolic reference to a method type or a method handle ([§5.1](5.1.md)). The method type or method handle is resolved ([§5.4.3.5](5.4.3.5.md)) and a `reference` to the resulting instance of `java.lang.invoke.MethodType` or `java.lang.invoke.MethodHandle`, *value*, is pushed onto the operand stack.

## Linking Exceptions

During resolution of the symbolic reference to a class, any of the exceptions pertaining to class resolution ([§5.4.3.1](5.4.3.1.md)) can be thrown.

During resolution of a symbolic reference to a method type or method handle, any of the exception pertaining to method type or method handle resolution ([§5.4.3.5](5.4.3.5.md)) can be thrown.

## Notes

The *ldc_w* instruction is identical to the *ldc* instruction ([§*ldc*](6.5.ldc.md)) except for its wider run-time constant pool index.

The *ldc_w* instruction can only be used to push a value of type `float` taken from the float value set ([§2.3.2](2.3.2.md)) because a constant of type `float` in the constant pool ([§4.4.4](4.4.4.md)) must be taken from the float value set.
