Array - Description


The generic class Array has a single type parameter T - the data type of the array. The generic class Array exists in the namespace calculus (in assembly Calculus.jar).

The declaration of the array class (in Java) is shown below.

public class Array<T> implements Collection<T>
{
 ...
}

Note that Lists and Stacks have been abolished. The Array class now does the duty of both of these. The interface of array is a superset of the interface of List; however, arrays also behave like sets because Array implements the Collection interface. Thus you can take the union of two arrays through the addAll method. This represents a major improvement on the in-built List class. It incorporates Array into collection theory - so you can do set theory on arrays.