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

# dup2

## Operation

Duplicate the top one or two operand stack values

## Format

```
dup2
```

## Forms

*dup2* = 92 (0x5c)

## Operand Stack

Form 1:

..., *value2*, *value1* →

..., *value2*, *value1*, *value2*, *value1*

where both *value1* and *value2* are values of a category 1 computational type ([§2.11.1](2.11.1.md)).

Form 2:

..., *value* →

..., *value*, *value*

where *value* is a value of a category 2 computational type ([§2.11.1](2.11.1.md)).

## Description

Duplicate the top one or two values on the operand stack and push the duplicated value or values back onto the operand stack in the original order.
