An array type is written as the name of an element type followed by some number
of empty pairs of square brackets []
. The number of bracket pairs indicates the
depth of array nesting. An array's length is not part of its type.
The element type of an array may be any type, whether primitive or reference. In particular:
abstract
class type as the component type are allowed. The elements of such an array may have as their value a null reference or instances of any subclass of the abstract
class that is not itself abstract
.
Array types are used in declarations and in cast expressions (§15.15).