Array PDF
Array PDF
Dawoud
An array is a sequenced collection of variables all
of the same type. Each variable, or cell, in an array
has an index, which uniquely refers to the value
stored in that cell. The cells of an array, A, are
numbered 0, 1, 2, and so on.
Each value stored in an array is often called an
element of that array.
Since the length of an array determines the maximum number
of things that can be stored in the array, we will sometimes
refer to the length of an array as its capacity.
In Java, the length of an array named a can be accessed using
the syntax a.length. Thus, the cells of an array, a, are
numbered 0, 1, 2, and so on, up through a.length−1, and the
cell with index k can be accessed with syntax a[k].
elementType [] arrayName=new elementType[length]
■ Access
■ Searching
■ Inserting
■ Deleting