CONSTANT_MethodType tag 16

A method descriptor as a value: loads as a java.lang.invoke.MethodType.

Tag
16
Since
class file 51.0 (Java 7)
Size
3 bytes
Loadable
yes, with ldc, ldc_w
Referred to by
  • bootstrap method arguments
  • ldc

Layout

TypeFieldWhat it holds
u1tag16
u2descriptor_indexa Utf8 method descriptor

What it is for

A method descriptor as a value: loads as a java.lang.invoke.MethodType. LambdaMetafactory receives two of them for every lambda: the erased interface method type and the instantiated one.

How common it is

JDK 25.0.5's java.base has 1,699 MethodType constants in 463 of its 7,391 classes: 0.16% of all 1,059,609 constants.

A real one, byte by byte

Constant #56 of Lambda.class, compiled by javac 25:

OffsetBytesFieldValue
7993 bytes#56 MethodType()V
79910tag16 (MethodType)
80000 06descriptor_index#6

Open in the viewer

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