Initialization : In initialization section, the variables are declared and initialized. Initialization will be executed only once and if it satisfies it goes to condition section.
Condition : In condition section, the condition is checked. If true, then control enters the loop and the statements are executed.Then the control goes to increment section. But if the condition is false, the loop is terminated.
Increment or Decrement : Once the loop gets executed the flow of control jumps back to Increment or Decrement section. Here the value gets incremented (or) decremented and again the control goes to condition section. This section is optional.
arrays. foreach works only on arrays.