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

# return

## Operation

Return `void` from method

## Format

```
return
```

## Forms

*return* = 177 (0xb1)

## Operand Stack

... →

[empty]

## Description

The current method must have return type `void`. If the current method is a `synchronized` method, the monitor entered or reentered on invocation of the method is updated and possibly exited as if by execution of a *monitorexit* instruction ([§*monitorexit*](6.5.monitorexit.md)) in the current thread. If no exception is thrown, any values on the operand stack of the current frame ([§2.6](2.6.md)) are discarded.

The interpreter then returns control to the invoker of the method, reinstating the frame of the invoker.

## Run-time Exceptions

If the Java Virtual Machine implementation does not enforce the rules on structured locking described in [§2.11.10](2.11.10.md), then if the current method is a `synchronized` method and the current thread is not the owner of the monitor entered or reentered on invocation of the method, *return* throws an `IllegalMonitorStateException`. This can happen, for example, if a `synchronized` method contains a *monitorexit* instruction, but no *monitorenter* instruction, on the object on which the method is `synchronized`.

Otherwise, if the Java Virtual Machine implementation enforces the rules on structured locking described in [§2.11.10](2.11.10.md) and if the first of those rules is violated during invocation of the current method, then *return* throws an `IllegalMonitorStateException`.
