This appendix began our introduction to data structures, exploring the use of arrays to store data in and retrieve data from lists and tables of values. The appendix examples demonstrated how to declare an array, initialize an array and refer to individual elements of an array. The appendix introduced the enhanced
for statement to iterate through arrays. We used exception handling to test for
ArrayIndexOutOfBoundsExceptions that occur when a program attempts to access an array element outside the bounds of an array. We also illustrated how to pass arrays to methods and how to declare and manipulate multidimensional arrays.
We introduced the
ArrayList<T> generic collection, which provides all the functionality and performance of ...