This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center




7年前关闭。




我想在Java中使用无限循环:for (;;),如果可以将';;'替换为变量'ever',我认为这很有趣。
像这样:
String ever = ";;";
for(ever){
...
}

在Java中这样的事情可能吗?

最佳答案

不,这是不可能的。

您能找到的最接近的是:

final boolean ever = true;
for (;ever;) { }

07-26 02:59