Module java.base
Package java.lang.classfile.attribute

# Interface ConstantValueAttribute

≠
public abstract sealed interface ConstantValueAttribute
extends java.lang.classfile.Attribute<java.lang.classfile.attribute.ConstantValueAttribute>, java.lang.classfile.FieldElement
permits jdk.internal.classfile.impl.BoundAttribute.BoundConstantValueAttribute, jdk.internal.classfile.impl.UnboundAttribute.UnboundConstantValueAttribute
Comparing jdk-master and valhalla-csr-open

All Superinterfaces:
  `AttributePREVIEW <ConstantValueAttribute>, ClassFileElement, FieldElement`

public sealed interface ConstantValueAttribute extends AttributePREVIEW <ConstantValueAttribute>, FieldElement
Models the `ConstantValue` attribute (JVMS §4.7.2), which indicates this field's value is a constant and that constant value.

This attribute only appears on fields, and does not permit multiple instances in a field. It has a data dependency on the constant pool.

This attribute was introduced in the Java Platform version 1.0.2, major version 45.

See Java Virtual Machine Specification:
  4.7.2 The `ConstantValue` Attribute
Since:
  24
See Also:
  - `Attributes.constantValue()`

## Methods

- =
  public abstract java.lang.classfile.constantpool.ConstantValueEntry constant()
- =
  public static java.lang.classfile.attribute.ConstantValueAttribute of(java.lang.classfile.constantpool.ConstantValueEntry arg0)
- =
  public static java.lang.classfile.attribute.ConstantValueAttribute of(java.lang.constant.ConstantDesc arg0)

## Summary

Differences
| Elements | Comments | Descriptions | Total
Added | Changed | Removed | Added | Changed | Removed | Added | Changed | Removed
--- | --- | --- | --- | --- | --- | --- | --- | ---
ConstantValueAttribute |  |  |  |  |  |  | 2 |  |  | 2
Total |  |  |  |  |  |  | 2 |  |  | 2