What you will learn in this chapter:
wrox.com code downloads for this chapter
You can find the wrox.com code downloads for this chapter at www.wrox.com/remtitle.cgi?isbn=9781118336922 on the Download Code tab. The code in the Chapter08 folder is individually named according to the names throughout the chapter.
In this chapter you learn about arrays, array lists, and collections. These data structures are useful to solve many types of programming problems. When you finish this chapter, you'll have an appreciation of how arrays can make certain programming problems much easier to solve.
An array is a group of identical data types that share a common name. The syntax to define an array is as follows:
typeSpecifier arrayName = new typeSpecifier[numberOfElements];
Each of these parts is explained in a moment using the following example.
Suppose you have an address book with 100 names in it. Because you want to manipulate those names in some way in your program, each unique name must be stored in a unique variable. Because names are textual data, you could use something like this: ...