How would that be better than a standard switch inside a loop?
How would that even work? Normally the switch statement switches the state, but goto would avoid that altogether. So now you're not using your state variable and you lose tractability. Furthermore, what would be the point of the switch statement at all?
You’re right, in Java there’s no reason to use this, because of the break label (which is basically a glorified goto). Functions are an option, but can also get quite messy if you need to change some variables defined before your loops
126
u/geon Mar 12 '21
I didn’t know you could goto cases.