CONSTANT_InterfaceMethodref tag 11

A reference to a method of an interface.

Tag
11
Since
class file 45.0 (Java 1.0)
Size
5 bytes
Loadable
no
Referred to by
  • invokeinterface
  • invokestatic and invokespecial on interface methods (Java 8 and later)
  • MethodHandle entries of kinds 6, 7 and 9

Layout

TypeFieldWhat it holds
u1tag11
u2class_indexa Class that is an interface
u2name_and_type_indexa NameAndType

What it is for

A reference to a method of an interface. The JVM checks the tag matches the class: using a Methodref for an interface method throws IncompatibleClassChangeError.

How common it is

JDK 25.0.5's java.base has 14,940 InterfaceMethodref constants in 2,857 of its 7,391 classes: 1.4% of all 1,059,609 constants.

A real one, byte by byte

Constant #7 of Boxing.class, compiled by javac 25:

OffsetBytesFieldValue
575 bytes#7 InterfaceMethodrefjava/util/List.iterator:()Ljava/util/Iterator;
570btag11 (InterfaceMethodref)
5800 08class_index#8
6000 09name_and_type_index#9

Open in the viewer

Specification: JVMS §4.4, CONSTANT_InterfaceMethodref_info (Java SE 25).