To sum up, if we wish to iterate over each value of an array
we dispose of tools such as
the iterations over a set of values.
We have just seen a concrete example of it.
We can also use a standard for iteration.
At that moment, the problem of the computation of
the array's size arises,
which we'll see further.
In reality there exists a third way of iterating over an array,
the one that uses the notion of iterator.
But this notion isn't presented in the context of this course.
Let's come back to the question at hand concerning standard iterations:
how can we specify the size of a fixed-size array?
How can we recover this size?
In Java, it is possible to get get the size of an array
from it's name.
To achieve this it is necessary to resort to a particular notation.
This notation is the following:
I use the array's name, followed by a point,
followed by the reserved word 'length'.
Here's a concrete example:
I declare/initialize an array scores that contains four elements.
If I want to print the array's size,
I just have to resort to the notation I've just described.
So the array's name, followed by a point, followed by 'length'
which will, here, obviously, print 4.
An analogous example here, with an array of booleans with two entries.