JVM Knowledge

arraylength

Raw .md Oracle

Operation

Get length of array

Format

arraylength

Forms

arraylength = 190 (0xbe)

Operand Stack

..., arrayref →

..., length

Description

The arrayref must be of type reference and must refer to an array. It is popped from the operand stack. The length of the array it references is determined. That length is pushed onto the operand stack as an int.

Run-time Exceptions

If the arrayref is null, the arraylength instruction throws a NullPointerException.