Top Description Methods
java.lang.classfile.instruction

public sealed Interface NewObjectInstruction

extends Instruction
Known Direct Implementers
jdk.internal.classfile.impl.AbstractInstruction.BoundNewObjectInstruction, jdk.internal.classfile.impl.AbstractInstruction.UnboundNewObjectInstruction
Annotations
@PreviewFeature
feature:CLASSFILE_API
Imports
java.lang.classfile.CodeElement, .CodeModel, .Instruction, java.lang.classfile.constantpool.ClassEntry, jdk.internal.classfile.impl.AbstractInstruction, jdk.internal.javac.PreviewFeature

Preview

Second Preview of ClassFile API (JEP 466).

Programs can only use NewObjectInstruction 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 new instruction in the code array of a Code attribute. Delivered as a CodeElement when traversing the elements of a CodeModel.
Since
22

Method Summary

Modifier and TypeMethod and Description
public ClassEntry

Returns:

the type of object to create
className
()

Returns the type of object to create.

public static NewObjectInstruction

Returns:

a new object instruction
of
(ClassEntry
the type of object to create
className
)

Returns a new object instruction.

Inherited from java.lang.classfile.Instruction:
opcodesizeInBytes

Method Detail

classNameback to summary
public ClassEntry className()

Returns the type of object to create.

Returns:ClassEntry

the type of object to create

ofback to summary
public static NewObjectInstruction of(ClassEntry className)

Returns a new object instruction.

Parameters
className:ClassEntry

the type of object to create

Returns:NewObjectInstruction

a new object instruction