Java Reference
In-Depth Information
6.1
Introduction to Arrays
334
Creating and Accessing Arrays
335
6
The
Instance Variable
338
length
Initializing Arrays
341
6.2
Arrays and References
344
Arrays Are Objects
344
Array Parameters
346
Arguments for the Method
354
main
Methods that Return an Array
355
Arrays
6.3
Programming with Arrays
356
Partially Filled Arrays
357
Example: A Class for Partially Filled Arrays
360
The “for-each” Loop
364
Methods with a Variable Number of Parameters
368
Example: A String Processing Example
371
Privacy Leaks with Array Instance Variables
372
Example: Sorting an Array
376
Enumerated Types
377
6.4
Multidimensional Arrays
387
Multidimensional Array Basics
387
Using the
Instance Variable
390
length
Ragged Arrays
391
Multidimensional Array Parameters and
391
Returned Values
Example: A Grade Book Class
392
Chapter Summary
398
Answers to Self-Test Exercises
399
Programming Projects
406
Search WWH ::




Custom Search