1.6.0 Java Loop Structures

  • Loops are used to execute blocks of code more than once
  • There are two types of loops.  A conditional loop and a counting loop
    • a conditional loop continues while a certain condition exists
    • a counting loop will loop for a certain number of times
  • the for loop lends itself to be a counting loop
  • the while loop lends itself to be a conditional loop
  • the do while loop lends itself to be a conditions loop that always executes at least once
More examples: