SPIRO THE TECH GURU

Back

What is Java Array?

By Admin on

                                                                      JAVA ARRAY


Normally, array is a collection of similar type of elements that have contiguous memory location.

Java array is an object the contains elements of similar data type. It is a data structure where we store similar elements. We can store only fixed set of elements in a java array.

Array in java is index based, first element of the array is stored at 0 index.

Advantages of Array:



  • Code Optimization: It makes the code optimized, we can retrieve or sort the data easily.
  • Random access: We can get any data located at any index position.


There are two types of array.

  • Single Dimensional Array and Multidimensional Array



SPIRO Google Plus