正如所有答案所指出的那样
goto-语言中有一个保留字,
Java并且未在该语言中使用。
restart:称为标识符,后跟冒号。
如果您希望实现某些
similar行为,则需要注意以下几点:
outer: // Should be placed exactly before the looploopingConstructOne { // We can have statements before the outer but not inbetween the label and the loop inner: loopingConstructTwo { continue; // This goes to the top of loopingConstructTwo and continue. break; // This breaks out of loopingConstructTwo. continue outer; // This goes to the outer label and reenters loopingConstructOne. break outer; // This breaks out of the loopingConstructOne. continue inner; // This will behave similar to continue. break inner; // This will behave similar to break. }}我不确定是否应该说
similar我已经说过的话。



