Chapter Summary
An array can be thought of as a collection of variables all of the same type.
Arrays are objects that are created using the operator
new, although the syntax is slightly different from that used when creating objects of a class.Array elements are numbered starting with 0 and ending with 1 less than the length of the array. If
ais an array,a[i]is an indexed variable of the array. The indeximust have a value greater than or equal to 0 and strictly less thana.length, the array’s length. Ifihas any other value when you run your program, an array index out-of-bounds error will occur, causing an error message.When an indexed variable is used as an argument to a method, it is treated just like any other argument whose data ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access