# Class ArrayType

java.lang.Object
org.apache.bcel.generic.Type
org.apache.bcel.generic.ReferenceType
org.apache.bcel.generic.ArrayType

public final class ArrayType extends ReferenceType
Denotes array type, such as int[][]

- ## Field Summary

  ### Fields inherited from class Type

  `BOOLEAN, BYTE, CHAR, CLASS, DOUBLE, FLOAT, INT, LONG, NO_ARGS, NULL, OBJECT, SHORT, signature, STRING, STRINGBUFFER, THROWABLE, type, UNKNOWN, VOID`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ArrayType(byte type, int dimensions)`
  Convenience constructor for array type, for example int[]
  `ArrayType(String className, int dimensions)`
  Convenience constructor for reference array type, for example Object[]
  `ArrayType(Type type, int dimensions)`
  Constructor for array of given type

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object type)`
  `Type`
  `getBasicType()`
  `String`
  `getClassName()`
  Gets the name of referenced class.
  `int`
  `getDimensions()`
  `Type`
  `getElementType()`
  `int`
  `hashCode()`

  ### Methods inherited from class ReferenceType

  `firstCommonSuperclass, getFirstCommonSuperclass, isAssignmentCompatibleWith, isCastableTo`

  ### Methods inherited from class Type

  `getArgumentTypes, getMethodSignature, getReturnType, getSignature, getSignature, getSize, getType, getType, getType, getTypes, normalizeForStackOrLocal, toString`

  ### Methods inherited from class Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### ArrayType

    public ArrayType(byte type, int dimensions)
    Convenience constructor for array type, for example int[]
    Parameters:
      `type` - array type, for example T_INT
      `dimensions` - array dimensions

  - ### ArrayType

    public ArrayType(String className, int dimensions)
    Convenience constructor for reference array type, for example Object[]
    Parameters:
      `className` - complete name of class (`String`, for example)
      `dimensions` - array dimensions

  - ### ArrayType

    public ArrayType(Type type, int dimensions)
    Constructor for array of given type
    Parameters:
      `type` - type of array (may be an array itself)
      `dimensions` - array dimensions

- ## Method Details

  - ### equals

    public boolean equals(Object type)
    Overrides:
      `equals` in class `Type`
    Returns:
      true if both type objects refer to the same array type.

  - ### getBasicType

    public Type getBasicType()
    Returns:
      basic type of array, i.e., for int[][][] the basic type is int

  - ### getClassName

    public String getClassName()
    Gets the name of referenced class.
    Overrides:
      `getClassName` in class `Type`
    Returns:
      name of referenced class.
    Since:
      6.7.0

  - ### getDimensions

    public int getDimensions()
    Returns:
      number of dimensions of array

  - ### getElementType

    public Type getElementType()
    Returns:
      element type of array, i.e., for int[][][] the element type is int[][]

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Type`
    Returns:
      a hash code value for the object.