in Java include an initializer, a condition and a counter expression. It is possible to include several expressions of the same kind using comma as delimiter (except in the condition). However, unlike C, the comma is just a delimiter and not an operator. for (int i = 0; i < 10; i++) { doSomething(); } // A more complex loop using two variables for (int i = 0, j = 9; i < 10; i++, j -= 3) { doSomething(); } Like C, all three expressions are optional. The following loop is infinite: for (;;) { doSomething(); } Enhanced for loop Enhanced for loops have been available since J2SE 5.0. This type of loop uses built-in iterators over arrays and collections to return each item in the given collection. Every element is returned and reachable in the context of the code block. When the block is executed, the next item is returned until there are no items remaining. Unlike C#, this kind of loop does not involve a special keyword, but instead uses a different notation style. for (int i : intArray) { doSomething(i); } Jump statements Labels Labels are given points in code used by break and continue statements. Note that the Java goto keyword cannot be used to jump to specific points in the code. start: someMethod(); break statement The break statement breaks out of the closest loop or switch statement. Execution continues in the statement after the terminated statement, if any. for (int i = 0; i < 10; i++) { while (true) { break; } // Will break to this point } It is possible to break out of the outer loop using labels: outer: for (int i = 0; i < 10; i++) { while (true) { break outer; } } // Will break to this point continue statement The continue statement discontinues the current iteration of the current control statement and begins the next iteration. The following while loop in the code below reads characters by calling getChar(), skipping the statements in the body of the loop if the characters are spaces: int ch; while (ch == getChar()) { if (ch == ' ') { continue; // Skips the rest of the while-loop } // Rest of the while-loop, will not be reached if ch == ' ' doSomething(); } Labels can be specified in continue statements and break statements: outer: for (String str