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
| Type | Field | What it holds |
|---|---|---|
u1 | tag | 16 |
u2 | descriptor_index | a 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:
| Offset | Bytes | Field | Value |
|---|---|---|---|
| 799 | 3 bytes | #56 MethodType | ()V |
| 799 | 10 | tag | 16 (MethodType) |
| 800 | 00 06 | descriptor_index | #6 |
Specification: JVMS §4.4, CONSTANT_MethodType_info (Java SE 25).