- Itteration is another word for loop or repeat.
- There are three main types of loops - for, while and do/while
- A loop requires a counter to keep track of when the stop the loop
- A counter is just a variable!
- A for loop has a start value, a condition and a increment
- the start value is only called once and is used to initialize the counter.
- the condition controls when the loop stops and must evaluate to boolean
- You can use && and || and even ! in conditions.
- the increment is called onlce the code block is complete. This is used to advance the counter closer to the condition.
- The code block must be contained in {}
- do/while will always run the code block once
- repeat/until is like do/while only the condition must evaluate to false and it is NOT used in java.
- You can convert between loops by following a very simple set of steps (see converting)
- You can nest loops like you can nest if statements