Quick Index
Advantages


Lightening Fast Indexed Access
Fixed array access is terrifically fast. And, the access time does not increase as the size of the array increases.

This speed is because a fixed array is in contiguous memory. This allows the use of simple arithmetic computations to compute an address location.

Extra info: Low level computing for array access.


Disadvantages


Size is Fixed
The size (number of elements) in the fixed array is fixed.

In otherwords, we can not add/append, insert or remove elements.


Typical Operations


We'll now look at typical fixed array operations. Most programming languages would support these or something similar.

Get
Get is a fundamental fixed array operation.

Fixed array elements are positioned in contiguous memory as shown. This means we can assume access [] will be fast (no matter how large index is).
array[5];
Set
Set is a fundamental fixed array operation.

We can also assume the set operation is efficient for the same reasons as get.
array[5] = "Foo";
Length
"length" is a fundamental fixed array operation.
array.length;
Example
Output:
Length: 4
array[0]: A
array[2]: C
Setting 'Z' at [1]
array[1]: Z


//By "array" we mean array length
String[] array = {"A", "B", "C", "D"};
prn("Length: " + array.length);
prn("array[0]: " + array[0]);
prn("array[2]: " + array[2]);
prn("Setting 'Z' at [1]");
array[1] = "Z";
prn("array[1]: " + array[1]);

5 or 5000000
As previously mentioned, access time is the same for accessing an element at index=5 or index=5000000.

In other words, operation time is not dependent on array size. This applies to both get and set.

We can also assume "length" will have fast constant performance
array[5];
bigArray[5000000];