this question has answer here:
is there simple way break out of inner loop, i.e. fro loop within loop? without having set additional flags example
there 3 basic methods:
using additional boolean flag
using labelled loop (
label: ...) ,break labelextracting loops separate function/method , using
returninstead ofbreak.
from code quality perspective believe 3. best solution.
Comments
Post a Comment