When size of a collection is unknown or the data space is sparse, an associative array is a better option. Associative arrays do not have any storage allocated until it is used, and the index expression is not restricted to integral expressions, but can be of any type.
An associative array implements a look-up table of the elements of its declared type. The data type to be used as an index serves as the lookup key and imposes an ordering.
data_type array_identifier [ index_type ];int array1 [int];// An integer array with integer indexint array2 [string];// An integer array with string indexstring array3 [string];// A string array with string index