Arrays

An array is an indexed and fixed size collection of homogeneous data elements. Arrays are used to represent a collection of data elements using a single variable. Using a single variable to represent multiple data elements increases readability of the code.

To use an array effectively, the number of data elements must be known in advance(which may not always be possible), as the size of a array is fixed and cannot be changed. Having too large an array, means wasted memory, and having too little an array, means not being able to store all data elements.