The input of array is taken using scanner class and is of type 1 2 3 and so on. Number of elements are not fixed