Java Reference
In-Depth Information
CHAPTER
7
S INGLE -D IMENSIONAL
A RRAYS
Objectives
To describe why arrays are necessary in programming (§7.1).
To declare array reference variables and create arrays (§§7.2.1-7.2.2).
To obtain array size using arrayRefVar.length and know default
values in an array (§7.2.3).
To access array elements using indexes (§7.2.4).
To declare, create, and initialize an array using an array initializer (§7.2.5).
To program common array operations (displaying arrays, summing
all elements, finding the minimum and maximum elements, random
shuffling, and shifting elements) (§7.2.6).
To simplify programming using the for each loops (§7.2.7).
To apply arrays in application development ( AnalyzeNumbers ,
DeckOfCards ) (§§7.3-7.4).
To copy contents from one array to another (§7.5).
To develop and invoke methods with array arguments and return values
(§§7.6-7.8).
To define a method with a variable-length argument list (§7.9).
To search elements using the linear (§7.10.1) or binary (§7.10.2)
search algorithm.
To sort an array using the selection sort approach (§7.11).
To use the methods in the java.util.Arrays class (§7.12).
To pass arguments to the main method from the command line (§7.13).
 
 
 
Search WWH ::




Custom Search