|
Accumulator Arrays
A Programming Pattern |
|
Prof. David Bernstein
|
| Computer Science Department |
| bernstdh@jmu.edu |
Given what you know, you might proceed as follows:
javaexamples/programmingpatterns/accumulatorarrays/AccumulatorArraysAlternative.java (Fragment: declarations)
if statement that is used to update
the appropriate accumulator is both awkward and error-prone