# Array

An array is a numerically indexed collection of elements holding values.

*Closest Wikipedia entry:* Array data type — In computer science, array is a data type that represents a collection of elements (values or variables), each selected by one or more indices (identifying keys) that can be computed at run time during program execution. Such a collection is usually called an array variable or array value. By analogy with the mathematical concepts vector and matrix, array types with one and two indices are often called vector type and matrix type, respectively.

## Misconceptions about Array21 documented Misconceptions

Check YourselfArrayAccessWithParentheses — Java

Parenthesis are used to access an element in an arrayArrayAllocationWithoutNew — Java

Arrays are created without the new keywordArrayBracketCountIsLength — Java

The number of brackets in an array type or an array initializer corresponds to the length of the arrayArrayElementTypeRepeats — Java

The type of a multi-dimensional array is written as T[] T[] T[]ArrayElementsUntyped — Java

Elements of arrays are untypedArrayHasLengthMethod — Java

To get the length of an array, one needs to call its length methodArrayInitializerContentsInBrackets — Java

Array initializers list the elements in square bracketsArrayLengthCannotBeZero — Java

An array cannot have a length of 0 elementsArrayLengthPartOfType — Java

The length of an array is part of its typeArrayListIsArray — Java

ArrayLists are arraysArrayRankIsLength — Java

Array rank and array length are the same thingArrayRankNotPartOfType — Java

The rank of an array is not part of its typeArraysGrow — Java

Arrays can grow dynamicallyForEachIteratesOverIndices — Java

An enhanced for loop iterates over the indices of an array or a collectionForEachVariableIsElement — Java

One can assign to the variable of an enhanced for statement to store a value in the corresponding array or collection elementMapInPlace — JavaScript

Map modifies the elements of the array on which it operates in placeMultidimensionalArray — Java

A multi-dimensional array is one thingNoJaggedArrays — Java

Multi-dimensional arrays have a rectangular shapeOnlyInnermostArrayElements — Java

Only the elements of the innermost array of a multi-dimensional array are accessibleOutOfBoundsElementsAreNull — Java

Out-of-bounds array elements are nullTypeofArrayIsArray — JavaScript

The typeof operator applied on an array returns 'array'