Package Summary Overview Summary

Module java.base
Package java.lang.classfile.instructionPREVIEW

# Interface NewReferenceArrayInstruction

All Superinterfaces:
  `ClassFileElementPREVIEW`, `CodeElementPREVIEW`, `InstructionPREVIEW`

public sealed interface NewReferenceArrayInstruction extends InstructionPREVIEW
`NewReferenceArrayInstruction` is a preview API of the Java platform.
Programs can only use `NewReferenceArrayInstruction` when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Models a `anewarray` invocation instruction in the `code` array of a `Code` attribute. Delivered as a `CodeElement`PREVIEW when traversing the elements of a `CodeModel`PREVIEW.

Since:
  22

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ClassEntryPREVIEW`
  `componentType()`
  Returns the component type of the array.
  `static NewReferenceArrayInstructionPREVIEW`
  `of (ClassEntryPREVIEW componentType)`
  Returns a new reference array instruction.

  ### Methods declared in interface java.lang.classfile.InstructionPREVIEW

  `opcode, sizeInBytes`

- ## Method Details

  - ### componentType

    ClassEntryPREVIEW componentType()
    Returns the component type of the array.
    Returns:
      the component type of the array

  - ### of

    static NewReferenceArrayInstructionPREVIEW of (ClassEntryPREVIEW componentType)
    Returns a new reference array instruction.
    Parameters:
      `componentType` - the component type of the array
    Returns:
      a new reference array instruction