---
spec: JVMS
title: "The Java Virtual Machine Specification"
edition: "Java SE 22 Edition"
java_version: 22
chapter: "Chapter 4. The class File Format"
section: "4.4.2"
heading: "4.4.2. The CONSTANT_Fieldref_info, CONSTANT_Methodref_info, and CONSTANT_InterfaceMethodref_info Structures"
parent: "4.4. The Constant Pool"
source: https://docs.oracle.com/javase/specs/jvms/se22/html/jvms-4.html#jvms-4.4.2
id: "4.4.2"
url: https://jvm.obfuscated.software/jvms/se22/4.4.2.html
raw: https://jvm.obfuscated.software/jvms/se22/4.4.2.md
---

# 4.4.2. The `CONSTANT_Fieldref_info`, `CONSTANT_Methodref_info`, and `CONSTANT_InterfaceMethodref_info` Structures

Fields, methods, and interface methods are represented by similar structures:

```
CONSTANT_Fieldref_info {
    u1 tag;
    u2 class_index;
    u2 name_and_type_index;
}

CONSTANT_Methodref_info {
    u1 tag;
    u2 class_index;
    u2 name_and_type_index;
}

CONSTANT_InterfaceMethodref_info {
    u1 tag;
    u2 class_index;
    u2 name_and_type_index;
}
```

The items of these structures are as follows:

- **tag**

  The `tag` item of a `CONSTANT_Fieldref_info` structure has the value `CONSTANT_Fieldref` (9).

  The `tag` item of a `CONSTANT_Methodref_info` structure has the value `CONSTANT_Methodref` (10).

  The `tag` item of a `CONSTANT_InterfaceMethodref_info` structure has the value `CONSTANT_InterfaceMethodref` (11).

- **class_index**

  The value of the `class_index` item must be a valid index into the `constant_pool` table. The `constant_pool` entry at that index must be a `CONSTANT_Class_info` structure ([§4.4.1](4.4.1.md)) representing a class or interface type that has the field or method as a member.

  In a `CONSTANT_Fieldref_info` structure, the `class_index` item may be either a class type or an interface type.

  In a `CONSTANT_Methodref_info` structure, the `class_index` item should be a class type, not an interface type.

  In a `CONSTANT_InterfaceMethodref_info` structure, the `class_index` item should be an interface type, not a class type.

- **name_and_type_index**

  The value of the `name_and_type_index` item must be a valid index into the `constant_pool` table. The `constant_pool` entry at that index must be a `CONSTANT_NameAndType_info` structure ([§4.4.6](4.4.6.md)). This `constant_pool` entry indicates the name and descriptor of the field or method.

  In a `CONSTANT_Fieldref_info` structure, the indicated descriptor must be a field descriptor ([§4.3.2](4.3.2.md)). Otherwise, the indicated descriptor must be a method descriptor ([§4.3.3](4.3.3.md)).

  If the name of the method in a `CONSTANT_Methodref_info` structure begins with a '`<`' ('`\u003c`'), then the name must be the special name `<init>`, representing an instance initialization method ([§2.9.1](2.9.1.md)). The return type of such a method must be `void`.
