Introduction to Array
Array indexes always begin with zero. The elements of an array are accessed using integer-valued indices. In Java, the first element of an array always has index zero. The length of an array is fixed at the time of its creation. An array represents related entities having same data type in contiguous or adjacent memory locations. The related data having data items form a group and are referred by the same name. To declare an array, write the data type, followed by a set of square brackets, followed by the identifier name. Elements of an array are accessed using their index values. Arrays have a length attribute which can be used for bounds checking. Whenever an array is accessed, the index is checked to ensure that it exists within the bounds of the array. The data type of array elements is known as the base type of the array.