Posts

Showing posts with the label Arrays .Types and operation of arrays in java

Arrays in java .Types of arrays. operations on arrays. advantages and features of array in java.

Array in java: Array: An array is a collection of similar data types. Array is a container object that hold values of homogeneous type. It is also known as static data structure because size of an array must be specified at the time of its declaration. Array is a collection of similar type of elements which has contiguous memory location. Arr ay Index:  The location of an element in an array has an index, which identifies the element. Array index starts from 0. Arr ay Element:  Items stored in an array is called an element. The elements can be accessed via its index. Arr ay Length:  The length of an array is defined based on the number of elements an array can store. In the above example, array length is 6 which means that it can store 6 elements. Array starts from  zero  index and goes to  n-1  where  n  is  length  of the array. Advantages of Array: 1 . Code ...