O'Reilly logo

Java Gently, Third Edition by Judith Bishop

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Arrays and tables

Arrays and tables

6.1 Simple arrays

6.2 Tables

6.3 The Graph class

6.4 Sorting and searching

6.5 Class-independent tables

Simple arrays

We are beginning to realize that there is a need to be able to store and manipulate multiple values in a program. If there are relatively few values, simple variables can possibly be used, but consider the following example.

Suppose we have several hundred scores between 0 and 19 which have to be analyzed for frequency of occurrence of each score. We could set up 20 counters, one for each score. As the scores are read in, the counter corresponding to the score could be incremented. It would be very unwieldy ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required