---
spec: JVMS
title: "The Java Virtual Machine Specification"
edition: "Java SE 18 Edition"
java_version: 18
chapter: "Chapter 4. The class File Format"
section: "4.4.8"
heading: "4.4.8. The CONSTANT_MethodHandle_info Structure"
parent: "4.4. The Constant Pool"
source: https://docs.oracle.com/javase/specs/jvms/se18/html/jvms-4.html#jvms-4.4.8
id: "4.4.8"
url: https://jvm.obfuscated.software/jvms/se18/4.4.8.html
raw: https://jvm.obfuscated.software/jvms/se18/4.4.8.md
---

# 4.4.8. The `CONSTANT_MethodHandle_info` Structure

The `CONSTANT_MethodHandle_info` structure is used to represent a method handle:

```
CONSTANT_MethodHandle_info {
    u1 tag;
    u1 reference_kind;
    u2 reference_index;
}
```

The items of the `CONSTANT_MethodHandle_info` structure are the following:

- **tag**

  The `tag` item has the value `CONSTANT_MethodHandle` (15).

- **reference_kind**

  The value of the `reference_kind` item must be in the range 1 to 9. The value denotes the *kind* of this method handle, which characterizes its bytecode behavior ([§5.4.3.5](5.4.3.5.md)).

- **reference_index**

  The value of the `reference_index` item must be a valid index into the `constant_pool` table. The `constant_pool` entry at that index must be as follows:

  - If the value of the `reference_kind` item is 1 (`REF_getField`), 2 (`REF_getStatic`), 3 (`REF_putField`), or 4 (`REF_putStatic`), then the `constant_pool` entry at that index must be a `CONSTANT_Fieldref_info` structure ([§4.4.2](4.4.2.md)) representing a field for which a method handle is to be created.
  - If the value of the `reference_kind` item is 5 (`REF_invokeVirtual`) or 8 (`REF_newInvokeSpecial`), then the `constant_pool` entry at that index must be a `CONSTANT_Methodref_info` structure ([§4.4.2](4.4.2.md)) representing a class's method or constructor ([§2.9.1](2.9.1.md)) for which a method handle is to be created.
  - If the value of the `reference_kind` item is 6 (`REF_invokeStatic`) or 7 (`REF_invokeSpecial`), then if the `class` file version number is less than 52.0, the `constant_pool` entry at that index must be a `CONSTANT_Methodref_info` structure representing a class's method for which a method handle is to be created; if the `class` file version number is 52.0 or above, the `constant_pool` entry at that index must be either a `CONSTANT_Methodref_info` structure or a `CONSTANT_InterfaceMethodref_info` structure ([§4.4.2](4.4.2.md)) representing a class's or interface's method for which a method handle is to be created.
  - If the value of the `reference_kind` item is 9 (`REF_invokeInterface`), then the `constant_pool` entry at that index must be a `CONSTANT_InterfaceMethodref_info` structure representing an interface's method for which a method handle is to be created.

  If the value of the `reference_kind` item is 5 (`REF_invokeVirtual`), 6 (`REF_invokeStatic`), 7 (`REF_invokeSpecial`), or 9 (`REF_invokeInterface`), the name of the method represented by a `CONSTANT_Methodref_info` structure or a `CONSTANT_InterfaceMethodref_info` structure must not be `<init>` or `<clinit>`.

  If the value is 8 (`REF_newInvokeSpecial`), the name of the method represented by a `CONSTANT_Methodref_info` structure must be `<init>`.
