【发布时间】:2012-12-24 11:34:39
【问题描述】:
我在 i++ 的 for 循环中收到了死代码警告。为什么我会得到这个,我该如何解决这个问题?
public static boolean Method(int p) {
for(int i = 2; i < p; i++) { // here is the problem, at i++
if(p % i == 0);
return false;
}
return true;
}
【问题讨论】:
-
这里的p值是多少?
-
你骗了我!那个分号很难看……
-
@jmendeth 总是这样! :)