Back to Intellij Community

UnnecessaryLabelOnContinueStatement

java/java-impl/resources/inspectionDescriptions/UnnecessaryLabelOnContinueStatement.html

2025.3-rc-2264 B
Original Source

Reports continue statements with unnecessary labels.

Example:

LABEL:
  while (a > b) {
    System.out.println("Hello");
    //the code below is the last statement in a loop,
    //so unnecessary label and continue can be removed
    continue LABEL;
  }