loops help
By Robert2.0, with 7 replies.
Last reply by danpost, over 11 years ago:
There are two syntax structures for the 'for' statement:
(1) for (index, condition, increment)
Lets say you wanted to add all the numbers from one to ten. You would start the index at one, increment by one, and continue adding as long as the index was not greater than 10.
<Code Omitted>The result will be that 'sum' will hold the value of fifty-five.
(2) for (Object item : itemList)
The loop will execute on each item of the list.
Let