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

# ldc2_w

## Operation

Push `long` or `double` from run-time constant pool (wide index)

## Format

```
ldc2_w
indexbyte1
indexbyte2
```

## Forms

*ldc2_w* = 20 (0x14)

## 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 must be a run-time constant of type `long` or `double` ([§5.1](5.1.md)). The numeric *value* of that run-time constant is pushed onto the operand stack as a `long` or `double`, respectively.

## Notes

Only a wide-index version of the *ldc2_w* instruction exists; there is no *ldc2* instruction that pushes a `long` or `double` with a single-byte index.

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