Skip to content

如何跳出双重循环? #22

@bitfishxyz

Description

@bitfishxyz

如何跳出双重循环?

for (Type type : types) {
    for (Type t : types2) {
         if (some condition) {
             // Do something and break...
             break; // Breaks out of the inner loop
         }
    }
}

上面的break只能跳出第一重循环

Metadata

Metadata

Assignees

No one assigned

    Labels

    SOStack Overflow相关问答

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions