MathContext MathContext(int, RoundingMode) in Java

MathContext(int, RoundingMode): This method is available in the java.math.MathContext class of Java.

Syntax:

java.math.MathContext.MathContext(int setPrecision, RoundingMode setRoundingMode)

This method takes two arguments. This method constructs a new MathContext with a specified precision and rounding mode.

Parameters: Two parameters are required for this method.

setPrecision: The non-negative int precision setting.

setRoundingMode: The rounding mode to use.

Throws:

1. IllegalArgumentException - if the setPrecision parameter is less than zero.

2. NullPointerException - if the rounding mode argument is null

Approach 1: When no exception

Java

package com.MathContext;

import java.math.MathContext;
import java.math.RoundingMode;

public class MathContext3 {
    public static void main(String[] args) {

        int setPrecision = 5;
        MathContext mathContext =
new MathContext(setPrecision, RoundingMode.CEILING);

        System.out.println(mathContext);
    }
}

Output:

precision=5 roundingMode=CEILING


Approach 2: IllegalArgumentException

Java

package com.MathContext;

import java.math.MathContext;
import java.math.RoundingMode;

public class MathContext3 {
    public static void main(String[] args) {

        int setPrecision = -5;
        MathContext mathContext =
new MathContext(setPrecision, RoundingMode.CEILING);

        System.out.println(mathContext);
    }
}

Output:

Exception in thread "main" java.lang.IllegalArgumentException: Digits < 0 at java.base/java.math.MathContext.<init>(MathContext.java:159) at com.MathContext.MathContext3.main(MathContext3.java:10)


Approach 3: NullPointerException

Java

package com.MathContext;

import java.math.MathContext;

public class MathContext3 {
    public static void main(String[] args) {

        int setPrecision = 5;
        MathContext mathContext =
new MathContext(setPrecision, null);

        System.out.println(mathContext);
    }
}

Output:

Exception in thread "main" java.lang.NullPointerException: null RoundingMode at java.base/java.math.MathContext.<init>(MathContext.java:161) at com.MathContext.MathContext3.main(MathContext3.java:9)


Some other methods of MathContext class

MathContext.DECIMAL128A MathContext object with a precision setting matching the IEEE 754R Decimal128 format, 34 digits, and rounding mode of HALF_EVEN, the IEEE 754R default.

MathContext.DECIMAL32A MathContext object with a precision setting matching the IEEE 754R Decimal32 format, 7 digits, and a rounding mode of HALF_EVEN, the IEEE 754R default.

MathContext.DECIMAL64A MathContext object with a precision setting matching the IEEE 754R Decimal64 format, 16 digits, and a rounding mode of HALF_EVEN, the IEEE 754R default.

equals(Object)This method compares this MathContext with the specified Object for equality.

getPrecision()This method returns the precision setting. This value is always non-negative.

getRoundingMode()This method returns the roundingMode setting.

hashCode()This method returns the hash code for this MathContext.

toString()This method returns the string representation of this MathContext.

MathContext.UNLIMITEDA MathContext object whose settings have the values required for unlimited precision arithmetic.

MathContext(int)This method constructs a new MathContext with the specified precision and the HALF_UP rounding mode.

MathContext(String)This method constructs a new MathContext from a string. The string must be in the same format as that produced by the toString method.

MathContext(int, RoundingMode)This method constructs a new MathContext with a specified precision and rounding mode.

MathContext MathContext(String) in Java

MathContext(String): This method is available in the java.math.MathContext class of Java.

Syntax:

java.math.MathContext.MathContext(String val)

This method takes one argument. This method constructs a new MathContext from a string. The string must be in the same format as that produced by the toString method.

An IllegalArgumentException is thrown if the precision section of the string is out of range (< 0) or the string is not in the format created by the toString method.

Parameters: One parameter is required for this method.

val: The string to be parsed.

Throws:

1. IllegalArgumentException - if the precision section is out of range or of incorrect format.

2. NullPointerException - if the argument is null

Approach 1: When no exception

Java

package com.MathContext;

import java.math.MathContext;

public class MathContext2 {
    public static void main(String[] args) {

        String val = "precision=5 roundingMode=HALF_UP";
        MathContext mathContext = new MathContext(val);

        System.out.println(mathContext);
    }
}

Output:

precision=5 roundingMode=HALF_UP


Approach 2: IllegalArgumentException

Java

package com.MathContext;

import java.math.MathContext;

public class MathContext2 {
    public static void main(String[] args) {

        String val = "118818";
        MathContext mathContext = new MathContext(val);

        System.out.println(mathContext);
    }
}

Output:

Exception in thread "main" java.lang.IllegalArgumentException: bad string format at java.base/java.math.MathContext.<init>(MathContext.java:200) at com.MathContext.MathContext2.main(MathContext2.java:9)


Approach 3: NullPointerException 

Java

package com.MathContext;

import java.math.MathContext;

public class MathContext2 {
    public static void main(String[] args) {

        String val = null;
        MathContext mathContext = new MathContext(val);

        System.out.println(mathContext);
    }
}

Output:

Exception in thread "main" java.lang.NullPointerException: null String at java.base/java.math.MathContext.<init>(MathContext.java:187) at com.MathContext.MathContext2.main(MathContext2.java:9)


Some other methods of MathContext class

MathContext.DECIMAL128A MathContext object with a precision setting matching the IEEE 754R Decimal128 format, 34 digits, and rounding mode of HALF_EVEN, the IEEE 754R default.

MathContext.DECIMAL32A MathContext object with a precision setting matching the IEEE 754R Decimal32 format, 7 digits, and a rounding mode of HALF_EVEN, the IEEE 754R default.

MathContext.DECIMAL64A MathContext object with a precision setting matching the IEEE 754R Decimal64 format, 16 digits, and a rounding mode of HALF_EVEN, the IEEE 754R default.

equals(Object)This method compares this MathContext with the specified Object for equality.

getPrecision()This method returns the precision setting. This value is always non-negative.

getRoundingMode()This method returns the roundingMode setting.

hashCode()This method returns the hash code for this MathContext.

toString()This method returns the string representation of this MathContext.

MathContext.UNLIMITEDA MathContext object whose settings have the values required for unlimited precision arithmetic.

MathContext(int)This method constructs a new MathContext with the specified precision and the HALF_UP rounding mode.

MathContext(String)This method constructs a new MathContext from a string. The string must be in the same format as that produced by the toString method.

MathContext(int, RoundingMode)This method constructs a new MathContext with a specified precision and rounding mode.

MathContext MathContext(int) in Java

MathContext(int): This method is available in the java.math.MathContext class of Java.

Syntax:

java.math.MathContext.MathContext(int setPrecision)

This method takes one argument. This method constructs a new MathContext with the specified precision and the HALF_UP rounding mode.

Parameters: One parameter is required for this method.

setPrecision: The non-negative int precision setting.

Throws:

1. IllegalArgumentException - if the setPrecision parameter is less than zero.

Approach 1: When no exception

Java

package com.MathContext;

import java.math.MathContext;

public class MathContext1 {
    public static void main(String[] args) {

        int setPrecision = 5;
        MathContext mathContext = new MathContext(setPrecision);

        System.out.println(mathContext);
    }
}

Output:

precision=5 roundingMode=HALF_UP


Approach 2: IllegalArgumentException 

Java

package com.MathContext;

import java.math.MathContext;

public class MathContext1 {
    public static void main(String[] args) {

        int setPrecision = -5;
        MathContext mathContext = new MathContext(setPrecision);

        System.out.println(mathContext);
    }
}

Output:

Exception in thread "main" java.lang.IllegalArgumentException: Digits < 0 at java.base/java.math.MathContext.<init>(MathContext.java:159) at java.base/java.math.MathContext.<init>(MathContext.java:142) at com.MathContext.MathContext1.main(MathContext1.java:9)


Some other methods of MathContext class

MathContext.DECIMAL128A MathContext object with a precision setting matching the IEEE 754R Decimal128 format, 34 digits, and rounding mode of HALF_EVEN, the IEEE 754R default.

MathContext.DECIMAL32A MathContext object with a precision setting matching the IEEE 754R Decimal32 format, 7 digits, and a rounding mode of HALF_EVEN, the IEEE 754R default.

MathContext.DECIMAL64A MathContext object with a precision setting matching the IEEE 754R Decimal64 format, 16 digits, and a rounding mode of HALF_EVEN, the IEEE 754R default.

equals(Object)This method compares this MathContext with the specified Object for equality.

getPrecision()This method returns the precision setting. This value is always non-negative.

getRoundingMode()This method returns the roundingMode setting.

hashCode()This method returns the hash code for this MathContext.

toString()This method returns the string representation of this MathContext.

MathContext.UNLIMITEDA MathContext object whose settings have the values required for unlimited precision arithmetic.

MathContext(int)This method constructs a new MathContext with the specified precision and the HALF_UP rounding mode.

MathContext(String)This method constructs a new MathContext from a string. The string must be in the same format as that produced by the toString method.

MathContext(int, RoundingMode)This method constructs a new MathContext with a specified precision and rounding mode.

MethodTypeDesc interface in Java

java.lang.constant.MethodTypeDesc

A nominal descriptor for a MethodType constant.

Declaration

public interface MethodTypeDesc extends ConstantDesc, TypeDescriptor.OfMethod<ClassDesc, MethodTypeDesc> {

    static MethodTypeDesc ofDescriptor(String descriptor) {
        return MethodTypeDescImpl.ofDescriptor(descriptor);
    }

    static MethodTypeDesc of(ClassDesc returnDesc, ClassDesc... paramDescs) {
        return new MethodTypeDescImpl(returnDesc, paramDescs);
    }

    ClassDesc returnType();

    int parameterCount();

    ClassDesc parameterType(int index);

    List<ClassDesc> parameterList();

    ClassDesc[] parameterArray();

    MethodTypeDesc changeReturnType(ClassDesc returnType);

    MethodTypeDesc changeParameterType(int index, ClassDesc paramType);

    MethodTypeDesc dropParameterTypes(int start, int end);

    MethodTypeDesc insertParameterTypes(int pos, ClassDesc... paramTypes);

    default String descriptorString() {
        return String.format("(%s)%s",
                Stream.of(parameterArray()).map(ClassDesc::descriptorString).collect(Collectors.joining()),
                returnType().descriptorString());
    }

    default String displayDescriptor() {
        return String.format("(%s)%s",
                Stream.of(parameterArray()).map(ClassDesc::displayName).collect(Collectors.joining(",")),
                returnType().displayName());
    }

    boolean equals(Object o);
}


Methods

1. ofDescriptor(String descriptor)

MethodTypeDesc java.lang.constant.MethodTypeDesc.ofDescriptor(String descriptor)

This method takes one argument. This method creates a MethodTypeDesc given a method descriptor string.

Parameters: One parameter is required for this method.

descriptor: a method descriptor string.

Returns: a MethodTypeDesc describing the desired method type.

Throws:

1. NullPointerException - if the argument is null.

2. IllegalArgumentException - if the descriptor string is not a valid method descriptor.


2. of(ClassDesc returnDesc, ClassDesc... paramDescs)

MethodTypeDesc java.lang.constant.MethodTypeDesc.of(ClassDesc returnDesc, ClassDesc... paramDescs)

This method takes two arguments. This method returns a MethodTypeDesc given the return type and parameter types.

Parameters: Two parameters are required for this method.

returnDesc: a ClassDesc describing the return type.

paramDescs: ClassDescs describing the argument types.

Returns: a MethodTypeDesc describing the desired method type.

Throws:

1. NullPointerException - if any argument or its contents are null.

2. IllegalArgumentException - if any element of paramDescs is a ClassDesc for void


3. returnType()

ClassDesc java.lang.constant.MethodTypeDesc.returnType()

This method gets the return type of the method type described by this MethodTypeDesc.

Returns: a ClassDesc describing the return type of the method type


4. parameterCount()

int java.lang.constant.MethodTypeDesc.parameterCount()

This method returns the number of parameters of the method type described by this MethodTypeDesc.

Returns: the number of parameters


5. parameterType(int index)

ClassDesc java.lang.constant.MethodTypeDesc.parameterType(int index)

This method takes one argument. This method returns the parameter type of the index's parameter of the method type described by this MethodTypeDesc.

Parameters: One parameter is required for this method.

index: the index of the parameter to retrieve.

Returns: a ClassDesc describing the desired parameter type.

Throws:

1. IndexOutOfBoundsException - if the index is outside the half-open range {[0, parameterCount())}


6. parameterList()

List<ClassDesc> java.lang.constant.MethodTypeDesc.parameterList()

This method returns the parameter types as an immutable List.

Returns: a List of ClassDesc describing the parameter types.


7. parameterArray()

ClassDesc[] java.lang.constant.MethodTypeDesc.parameterArray()

This method returns the parameter types as an array.

Returns: an array of ClassDesc describing the parameter types.


8. changeReturnType(ClassDesc returnType)

MethodTypeDesc java.lang.constant.MethodTypeDesc.changeReturnType(ClassDesc returnType)

This method takes one argument. This method returns a MethodTypeDesc that is identical to this one, except with the specified return type.

Parameters: One parameter is required for this method.

returnType:ClassDesc describing the new return type.

Returns: a MethodTypeDesc describing the desired method type.

Throws:

1. NullPointerException - if the argument is null.


9. changeParameterType(int index, ClassDesc paramType)

MethodTypeDesc java.lang.constant.MethodTypeDesc.changeParameterType(int index, ClassDesc paramType)

This method takes two arguments. This method returns a MethodTypeDesc that is identical to this one, except that a single parameter type has been changed to the specified type.

Parameters: Two parameters are required for this method.

index: the index of the parameter to change.

paramType: a ClassDesc describing the new parameter type.

Returns: a MethodTypeDesc describing the desired method type.

Throws:

1. NullPointerException - if any argument is null.

2. IndexOutOfBoundsException - if the index is outside the half-open range {[0, parameterCount)}.


10. dropParameterTypes(int start, int end)

MethodTypeDesc java.lang.constant.MethodTypeDesc.dropParameterTypes(int start, int end)

This method takes two arguments. This method returns a MethodTypeDesc that is identical to this one, except that a range of parameter types have been removed.

Parameters: Two parameters are required for this method.

start: the index of the first parameter to remove.

end: the index after the last parameter to remove.

Returns: a MethodTypeDesc describing the desired method type.

Throws:

1. IndexOutOfBoundsException - if start is outside the half-open range [0, parameterCount), or end is outside the closed range [0, parameterCount], or if start > end.


11. insertParameterTypes(int pos, ClassDesc... paramTypes)

MethodTypeDesc java.lang.constant.MethodTypeDesc.insertParameterTypes(int pos, ClassDesc... paramTypes)

This method takes two arguments. This method returns a MethodTypeDesc that is identical to this one, except that a range of additional parameter types have been inserted.

Parameters: Two parameters are required for this method.

pos: the index at which to insert the first inserted parameter.

paramTypes: ClassDescs describing the new parameter types to insert.

Returns: a MethodTypeDesc describing the desired method type.

Throws:

1. NullPointerException - if any argument or its contents are null.

2. IndexOutOfBoundsException - if pos is outside the closed range {[0, parameterCount]}.

3. IllegalArgumentException - if any element of paramTypes is a ClassDesc for void


12. descriptorString()

String java.lang.constant.MethodTypeDesc.descriptorString()

This method returns the method type descriptor string.

Returns: the method type descriptor string.


13. displayDescriptor()

String java.lang.constant.MethodTypeDesc.displayDescriptor()

This method returns a human-readable descriptor for this method type, using the canonical names for parameter and return types.

Returns: the human-readable descriptor for this method type.


14. equals(Object o)

boolean java.lang.constant.MethodTypeDesc.equals(Object o)

This method takes one argument. This method compares the specified object with this descriptor for equality. Returns true if and only if the specified object is also a MethodTypeDesc both have the same arity, their return types are equal, and each pair of corresponding parameter types are equal.

Parameters: One parameter is required for this method.

o: the other object.

Returns: whether this descriptor is equal to the other object.


Some other classes/interfaces of java.lang.constant

MethodTypeDescA nominal descriptor for a MethodType constant.

MethodHandleDescA nominal descriptor for a MethodHandle constant.

DynamicConstantDescA nominal descriptor for a dynamic constant.

DynamicCallSiteDescA nominal descriptor for an invoke dynamic call site.

DirectMethodHandleDescA nominal descriptor for a direct MethodHandle. A DirectMethodHandleDesc corresponds to a Constant_MethodHandle_info entry in the constant pool of a class file.

ConstantDescsPredefined values of nominal descriptors for common constants, including descriptors for primitive class types and other common platform types, and descriptors for method handles for standard bootstrap methods.

ConstantDescA nominal descriptor for a loadable constant value. Such a descriptor can be resolved via ConstantDesc.resolveConstantDesc(MethodHandles.Lookup) to yield the constant value itself.

ConstableRepresents a type that is constable. A constable type is one whose values are constants that can be represented in the constant pool of a Java class file.

ClassDescA nominal descriptor for a Class constant.

MethodHandleDesc interface in Java

java.lang.constant.MethodHandleDesc

A nominal descriptor for a MethodHandle constant.

Declaration

public interface MethodHandleDesc extends ConstantDesc {

    static DirectMethodHandleDesc of(DirectMethodHandleDesc.Kind kind, ClassDesc owner, String name,
            String lookupDescriptor) {
        switch (kind) {
        case GETTER:
        case SETTER:
        case STATIC_GETTER:
        case STATIC_SETTER:
            return ofField(kind, owner, name, ClassDesc.ofDescriptor(lookupDescriptor));
        default:
            return new DirectMethodHandleDescImpl(kind, owner, name, MethodTypeDesc.ofDescriptor(lookupDescriptor));
        }
    }

    static DirectMethodHandleDesc ofMethod(DirectMethodHandleDesc.Kind kind, ClassDesc owner, String name,
            MethodTypeDesc lookupMethodType) {
        switch (kind) {
        case GETTER:
        case SETTER:
        case STATIC_GETTER:
        case STATIC_SETTER:
            throw new IllegalArgumentException(kind.toString());
        case VIRTUAL:
        case SPECIAL:
        case INTERFACE_VIRTUAL:
        case INTERFACE_SPECIAL:
        case INTERFACE_STATIC:
        case STATIC:
        case CONSTRUCTOR:
            return new DirectMethodHandleDescImpl(kind, owner, name, lookupMethodType);
        default:
            throw new IllegalArgumentException(kind.toString());
        }
    }

    static DirectMethodHandleDesc ofField(DirectMethodHandleDesc.Kind kind, ClassDesc owner, String fieldName,
            ClassDesc fieldType) {
        MethodTypeDesc mtr;
        switch (kind) {
        case GETTER:
            mtr = MethodTypeDesc.of(fieldType, owner);
            break;
        case SETTER:
            mtr = MethodTypeDesc.of(CD_void, owner, fieldType);
            break;
        case STATIC_GETTER:
            mtr = MethodTypeDesc.of(fieldType);
            break;
        case STATIC_SETTER:
            mtr = MethodTypeDesc.of(CD_void, fieldType);
            break;
        default:
            throw new IllegalArgumentException(kind.toString());
        }
        return new DirectMethodHandleDescImpl(kind, owner, fieldName, mtr);
    }

    static DirectMethodHandleDesc ofConstructor(ClassDesc owner, ClassDesc... paramTypes) {
        return MethodHandleDesc.ofMethod(CONSTRUCTOR, owner, ConstantDescs.DEFAULT_NAME,
                MethodTypeDesc.of(CD_void, paramTypes));
    }

    default MethodHandleDesc asType(MethodTypeDesc type) {
        return (invocationType().equals(type)) ? this : new AsTypeMethodHandleDesc(this, type);
    }

    MethodTypeDesc invocationType();

    boolean equals(Object o);
}


Methods

1. of(Kind kind, ClassDesc owner, String name, String lookupDescriptor)

DirectMethodHandleDesc java.lang.constant.MethodHandleDesc.of(Kind kind, ClassDesc owner, String name, String lookupDescriptor)

This method takes four arguments. This method creates a MethodHandleDesc corresponding to an invocation of a declared method, invocation of a constructor, or access to a field.

Parameters: Four parameters are required for this method.

kind: The kind of method handle to be described.

owner: a ClassDesc describing the class containing the method, constructor, or field.

name: the unqualified name of the method or field.

lookupDescriptor: a method descriptor string the lookup type, if the request is for a method invocation, or describing the invocation type if the request is for a field or constructor.

Returns: the MethodHandleDesc.

Throws:

1. NullPointerException - if any of the non-ignored arguments are null.

2. IllegalArgumentException - if the descriptor string is not a valid method or field descriptor.


2. DirectMethodHandleDesc java.lang.constant.MethodHandleDesc.ofMethod(Kind kind, ClassDesc owner, String name, MethodTypeDesc lookupMethodType)

This method takes four arguments. This method creates a MethodHandleDesc corresponding to an invocation of a declared method or constructor.

Parameters: Four parameters are required for this method.

kind: The kind of method handle to be described; must be one of SPECIAL, VIRTUAL, STATIC, INTERFACE_SPECIAL, INTERFACE_VIRTUAL, INTERFACE_STATIC, CONSTRUCTOR.

owner: a ClassDesc describing the class containing the method or constructor.

name: the unqualified name of the method (ignored if the kind is CONSTRUCTOR).

lookupMethodType: a MethodTypeDesc describing the lookup type.

Returns: the MethodHandleDesc.

Throws:

1. NullPointerException - if any non-ignored arguments are null.

2. IllegalArgumentException - if the name has the incorrect format or the kind is invalid.


3. ofField(Kind kind, ClassDesc owner, String fieldName, ClassDesc fieldType)

DirectMethodHandleDesc java.lang.constant.MethodHandleDesc.ofField(Kind kind, ClassDesc owner, String fieldName, ClassDesc fieldType)

This method takes four arguments. This method creates a MethodHandleDesc corresponding to a method handle that accesses a field.

Parameters: Four parameters are required for this method.

kind: the kind of method handle to be described; must be one of GETTER, SETTER, STATIC_GETTER, or STATIC_SETTER.

owner: a ClassDesc describing the class containing the field.

fieldName: the unqualified name of the field.

fieldType: a ClassDesc describing the type of the field.

Returns: the MethodHandleDesc.

Throws:

1. NullPointerException - if any of the arguments are null.

2. IllegalArgumentException - if the kind is not one of the valid values or if the field name is not valid.


4. ofConstructor(ClassDesc owner, ClassDesc... paramTypes)

DirectMethodHandleDesc java.lang.constant.MethodHandleDesc.ofConstructor(ClassDesc owner, ClassDesc... paramTypes)

This method takes two arguments. This method returns a MethodHandleDesc corresponding to the invocation of a constructor

Parameters: Two parameters are required for this method.

owner: a ClassDesc describing the class containing the constructor.

paramTypes: ClassDescs describing the parameter types of the constructor.

Returns: the MethodHandleDesc.

Throws:

1. NullPointerException - if any argument or its contents is null.


5. asType(MethodTypeDesc type)

MethodHandleDesc java.lang.constant.MethodHandleDesc.asType(MethodTypeDesc type)

This method takes one argument. This method returns a MethodHandleDesc that describes this method handle adapted to a different type.

Parameters: One parameter is required for this method.

type: a MethodHandleDesc describing the new method type.

Returns: a MethodHandleDesc for the adapted method handle.

Throws:

1. NullPointerException - if the argument is null.


6. invocationType()

MethodTypeDesc java.lang.constant.MethodHandleDesc.invocationType()

This method returns a MethodTypeDesc describing the invocation type of the method handle described by this nominal descriptor. The invocation type describes the full set of stack values that are consumed by the invocation.

Parameters: NA

Returns: MethodHandleDesc describing the method handle type.


7. equals(Object o)

boolean java.lang.constant.MethodHandleDesc.equals(Object o)

This method takes one argument. This method compares the specified object with this descriptor for equality. Returns true if and only if the specified object is also a MethodHandleDesc, and both encode the same nominal description of a method handle.

Parameters: One parameter is required for this method.

o: the other object.

Returns: whether this descriptor is equal to the other object.


Some other classes/interfaces of java.lang.constant

MethodTypeDescA nominal descriptor for a MethodType constant.

MethodHandleDescA nominal descriptor for a MethodHandle constant.

DynamicConstantDescA nominal descriptor for a dynamic constant.

DynamicCallSiteDescA nominal descriptor for an invoke dynamic call site.

DirectMethodHandleDescA nominal descriptor for a direct MethodHandle. A DirectMethodHandleDesc corresponds to a Constant_MethodHandle_info entry in the constant pool of a class file.

ConstantDescsPredefined values of nominal descriptors for common constants, including descriptors for primitive class types and other common platform types, and descriptors for method handles for standard bootstrap methods.

ConstantDescA nominal descriptor for a loadable constant value. Such a descriptor can be resolved via ConstantDesc.resolveConstantDesc(MethodHandles.Lookup) to yield the constant value itself.

ConstableRepresents a type that is constable. A constable type is one whose values are constants that can be represented in the constant pool of a Java class file.

ClassDescA nominal descriptor for a Class constant.