Definition: An assemblage of items that are randomly accessible by integers, the index.
An array, as the Java programming language defines, is a container that holds a fixed number of values of a single type. We will be using this definition in this class. The length of the array is established when the array is created. Each item in an array is called an element, each of which is is accessed by a numerical index. As shown in the illustration, the index begins with 0. The 9th element, for example, would therefore be accessed at index 8.
References:
Black, Paul E. (2016-11-16). Pieterse, Vreda; Black, Paul E. (eds.). "array". Dictionary of Algorithms and Data Structures. National Institute of Standards and Technology. Retrieved from: https://xlinux.nist.gov/dads/HTML/array.html
Arrays are fixed memory allocation in memory.
Accessing arrays is like addresses for buildings. Because of fixed positions, you can access an element by it's position.
Pros:
Cons:
Creating an array in Java involves distinct steps such as:
Other properties of arrays implemented in Java: