Yes.
Often parameters are used to "fine-tune" the actions
performed by a method.
For example,
imagine that you want to print only some of the
elements of an array.
Here is the ArrayOps
class definition with
a new method added:
The method printRange()
prints the elements
from start
to (and including) end
.
In this particular program,
main()
uses the method to print the elements
at indexes
1 through 5.
The values 19, 1, 5, -1, 27 are printed.
Fill in the blanks for printRange()
.
Assume that start
and end
are legal indexes for the array.