ABSTRACT

This chapter describes about an important data structure an array. An array consists of a fixed number of items of the same type arranged in a specific order. Array indexes are zero based; in other words, the first item in the array has zero as its index. An array can create with the new operator; the elements of such an array will be initialized to a default value that is appropriate to the type of an array. An array variable actually stores the address where the array is located in the computer's memory. Using an index that is greater than or equal to the length of the array can cause an out-of-bounds exception. Counting loops, especially for loops, are useful for processing arrays. An array is a kind of object, evidenced by its length property, which stores the length, of a given array. Processing provides several functions that can be used with arrays, including printArray(), min(), and max().