> ## Documentation Index
> Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Java Continue Statement

The `continue` statement is an unconditional branching control flow construct that immediately terminates the execution of the current iteration within an enclosing loop. Upon execution, control is transferred directly to the loop's next iteration phase, bypassing any remaining statements in the current loop body.

The exact transfer of control depends on the type of the enclosing loop:

* **Traditional `for` loop:** Control jumps to the loop's update expression, followed by the evaluation of the boolean termination condition.
* **Enhanced `for` loop (for-each):** Control transfers to the underlying iterator to check for and fetch the next element; there is no explicit update expression.
* **`while` and `do-while` loops:** Control jumps directly to the evaluation of the boolean termination condition.

Java supports two forms of the `continue` statement: **unlabeled** and **labeled**.

## Unlabeled `continue`

The unlabeled form affects only the innermost enclosing loop. It halts the current iteration of that specific loop and proceeds to its next iteration.

**Syntax:**

```java theme={"dark"}
continue;
```

**Control Flow Visualization:**

```java theme={"dark"}
for (int i = 0; i < 10; i++) {
    // Statement A executed every iteration
    
    if (i % 2 == 0) {
        continue; // Halts current iteration, transfers control to i++
    }
    
    // Statement B executed ONLY if the condition evaluates to false
}
```

## Labeled `continue`

The labeled form is used in conjunction with nested loops. It allows the developer to skip the current iteration of a specific outer loop, rather than the innermost loop. The label must immediately precede the target loop declaration.

**Syntax:**

```java theme={"dark"}
continue labelName;
```

**Control Flow Visualization:**

```java theme={"dark"}
outerLoopLabel: 
for (int i = 0; i < 5; i++) {
    for (int j = 0; j < 5; j++) {
        
        if (i == j) {
            // Halts current iteration of BOTH loops.
            // Transfers control directly to i++ (the outer loop's update expression).
            continue outerLoopLabel; 
        }
        
        // Statement C
    }
    // Statement D
}
```

## Technical Constraints

* A `continue` statement must be strictly contained within the body of a `for` (traditional or enhanced), `while`, or `do-while` loop. Using it outside of a loop construct results in a compilation error.
* A labeled `continue` must reference a valid label that is attached to an enclosing loop construct. Referencing a label attached to a non-loop block (like an `if` statement or a generic code block) will result in a compilation error.

<div
  style={{ 
display: "flex", 
justifyContent: "space-between", 
alignItems: "center", 
maxWidth: "754px", 
padding: "1rem 0",
marginBottom: "24px"
}}
>
  <span style={{ fontWeight: "bold", fontSize: "1.25rem", color: "var(--tw-prose-headings)", fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif" }}>Tired of Poor Java Skills? Fix That With Deep Grasping!</span>

  <a
    href="https://syntblaze.com"
    target="_blank"
    style={{ 
  marginLeft: "24px",
  textDecoration: "none", 
  backgroundColor: "#007AFF",
  color: "#ffffff", 
  padding: "6px 16px", 
  borderRadius: "16px",
  fontSize: "0.9rem",
  fontWeight: "600",
  textAlign: "center",
  transition: "background-color 0.2s ease"
}}
  >
    Learn More
  </a>
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/skill-tracking.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=b9b0305c93bb501c9e767b5c76c88835" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/skill-tracking.png" />

  <img src="https://mintcdn.com/syntblazellc/23tyuOzaWS88qFlc/images/nuggets.png?fit=max&auto=format&n=23tyuOzaWS88qFlc&q=85&s=c86c80197299762989e9b882419b2109" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/nuggets.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/bite-sized-exercises.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=a65f9a38c37ff28ab73ed783c53c60e3" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/bite-sized-exercises.png" />
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap", marginTop: "12px" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/mastery-chain.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=748a1763454713e679260fbb95f154a2" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/mastery-chain.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-previews.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=242f61448ff5dd6deaaab2dccc13b507" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-previews.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-explanations.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=cf0fc1c31f9cd0fc26716781be05fbc9" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-explanations.png" />
</div>
