我有一个循环迭代等于数组的长度,在这个循环内我有一个方法做一些处理,并有内部的if-else结构。我想,如果某些条件是真的,那么重新循环整个循环,否则继续。 提供最低工作代码。 fp.factprocess的返回INT从一个循环中的语句if语句
for(int xx=0;xx<temp.length;xx++)
{
rule=temp[xx][1];
cons=temp[xx][2];
fp.factprocess(fact, rule, vars, cons);
}
内容就像
if(condition==true)
make xx = 0 in the parent loop
else
continue
我不知道该怎么做呢,我用return语句,但它必须是到底,不能在如 - 块。
好的....感谢分享。 – specializt
[什么是XY问题?](http://meta.stackexchange.com/a/66378) – flakes