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

# ifnull

## Operation

Branch if `reference` is `null`

## Format

```
ifnull
branchbyte1
branchbyte2
```

## Forms

*ifnull* = 198 (0xc6)

## Operand Stack

..., *value* →

...

## Description

The *value* must of type `reference`. It is popped from the operand stack. If *value* is `null`, the unsigned *branchbyte1* and *branchbyte2* are used to construct a signed 16-bit offset, where the offset is calculated to be (*branchbyte1* `<<` 8) | *branchbyte2*. Execution then proceeds at that offset from the address of the opcode of this *ifnull* instruction. The target address must be that of an opcode of an instruction within the method that contains this *ifnull* instruction.

Otherwise, execution proceeds at the address of the instruction following this *ifnull* instruction.
