|
|||
|
|||
Iteration and Loops in Java
|
|||
|
Iterations allow us to execute the same lines of code multiple times. In Java 1.4.2, we can use the while loop, the do-while loop, and the for loop. When would you use these loops? Think of some examples. When designing a loop, you may end up with an infinite loop, either intentionally or unintentionally. When designing variables, be careful to consider their scope in a loop. The book mentions several other 'watch-outs'. Among them:
|