Non-trivial computing problems often require storing lists of items. Often these items can be referred to by their position in the list. Sometimes this ordering is natural as in a list of the first ten people to arrive at a sale. The first person would be item one in the list, the second person to arrive would be item two, and so on. Other times the ordering doesn't really mean anything, but it's still convenient to be able to assign each item a unique number and enumerate all the items in a list by counting out the numbers.
There are many ways to store lists of items including linked lists, sets, hash tables, binary trees and arrays. Which one you choose depends on the requirements of your application and the nature of your data. Java provides classes for many of these ways to store data. In this chapter youšll explore the simplest and most common, the array.
In this chapter you learn about