3 ms·
> The clearest way to express certain algorithms really does involve a (local) goto. Java doesn't have goto, but it has labeled break and continue statements.
by 10ren 17y ago
> The clearest way to express certain algorithms really does involve a (local) goto.
Java doesn't have goto, but it has labeled break and continue statements. Great for exiting nested loops. Exceptions are another kind of structured goto. Of all the criticisms of Java, I've never heard the lack of goto bemoaned.
One thing I love about the Java designers is their humility: they thought the above was enough to cover all the cases where a goto was really convenient, but still made goto a reserved word. Just in case.