Serializable, Comparable<TypeKind>, Constablepublic enum TypeKind extends Enum<TypeKind>
returnAddress (JVMS 2.3.3) and includes void (JVMS 4.3.3), which appears as a method return type. The returnAddress type is only used by discontinued jump subroutine and return from subroutine instructions. Jump subroutine instructions push returnAddress to the operand stack; astore instructions store
returnAddress from the operand stack to local variables; return from subroutine instructions load returnAddress from local variables.
class file format, local variables (JVMS 2.6.1), and the operand stack (JVMS 2.6.2) of the Java Virtual Machine, boolean, byte, char, short types do not exist and are represented by the int computational type. int, float, reference, returnAddress, long, and doule are the computational types of the Java Virtual Machine.Enum.EnumDesc<E>
| Enum Constant | Description |
|---|---|
BOOLEAN |
The primitive type boolean. |
BYTE |
The primitive type byte. |
CHAR |
The primitive type char. |
DOUBLE |
The primitive type double. |
FLOAT |
The primitive type float. |
INT |
The primitive type int. |
LONG |
The primitive type long. |
REFERENCE |
A reference type. |
SHORT |
The primitive type short. |
VOID |
The void type, for absence of a value. |
| Modifier and Type | Method | Description |
|---|---|---|
TypeKind |
asLoadable() |
|
static TypeKind |
from |
Returns the type associated with the specified field descriptor. |
static TypeKind |
fromDescriptor |
Returns the type associated with the specified field descriptor. |
static TypeKind |
fromNewarrayCode |
Returns the component type described by the array code used as an operand to newarray. |
int |
newarrayCode() |
Returns the code used by the newarray instruction to create an array of this component type, or -1 if this type is not supported by newarray. |
int |
slotSize() |
Returns the number of local variable index or operand stack depth consumed by this type. |
ClassDesc |
upperBound() |
Returns the most specific upper bound field descriptor that can store any value of this type. |
static TypeKind |
valueOf |
Returns the enum constant of this class with the specified name. |
static TypeKind[] |
values() |
Returns an array containing the constants of this enum class, in the order they are declared. |
public static final TypeKind BOOLEAN
boolean. Its computational type is int. 0 represents false, and 1 represents true. It is zero-extended to an int when loaded onto the operand stack and narrowed by taking the bitwise AND with 1 when stored.boolean Typepublic static final TypeKind BYTE
byte. Its computational type is int. It is sign-extended to an int when loaded onto the operand stack and truncated when stored.public static final TypeKind CHAR
char. Its computational type is int. It is zero-extended to an int when loaded onto the operand stack and truncated when stored.public static final TypeKind SHORT
short. Its computational type is int. It is sign-extended to an int when loaded onto the operand stack and truncated when stored.public static final TypeKind INT
int.public static final TypeKind LONG
long. It is of category 2.public static final TypeKind FLOAT
float. All NaN values of float may or may not be collapsed into a single "canonical" NaN value in loading and storing.public static final TypeKind DOUBLE
double. It is of category 2. All NaN values of double may or may not be collapsed into a single "canonical" NaN value in loading and storing.public static final TypeKind REFERENCE
public static final TypeKind VOID
void type, for absence of a value. While this is not a data type, this can be a method return type indicating no change in operand stack depth.public static TypeKind[] values()
public static TypeKind valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum class has no constant with the specified nameNullPointerException - if the argument is nullpublic ClassDesc upperBound()
void and Object descriptor for reference.public int newarrayCode()
newarray instruction to create an array of this component type, or -1 if this type is not supported by newarray.newarray instruction to create an array of this component type, or -1 if this type is not supported by newarray
public int slotSize()
pop versus pop2.public TypeKind asLoadable()
void for void
public static TypeKind fromNewarrayCode(int newarrayCode)
newarray.newarrayCode - the operand of the newarray instructionnewarray
IllegalArgumentException - if the code is invalidpublic static TypeKind fromDescriptor(CharSequence s)
s - the field descriptorIllegalArgumentException - only if the descriptor is not validpublic static TypeKind from(TypeDescriptor.OfField<?> descriptor)
descriptor - the field descriptor
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/classfile/TypeKind.html