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

# iinc

## Operation

Increment local variable by constant

## Format

```
iinc
index
const
```

## Forms

*iinc* = 132 (0x84)

## Operand Stack

No change

## Description

The *index* is an unsigned byte that must be an index into the local variable array of the current frame ([§2.6](2.6.md)). The *const* is an immediate signed byte. The local variable at *index* must contain an `int`. The value *const* is first sign-extended to an `int`, and then the local variable at *index* is incremented by that amount.

## Notes

The *iinc* opcode can be used in conjunction with the *wide* instruction ([§*wide*](6.5.wide.md)) to access a local variable using a two-byte unsigned index and to increment it by a two-byte immediate signed value.
