public class Three {
public static void main(String[] args) {
Three obj = new Three();
obj.function(600851475143);
}
private Long function(long i) {
Stack<Long> stack = new Stack<Long>();
for (long j = 2; j <= i; j++) {
if (i % j == 0) {
stack.push(j);
}
}
return stack.pop();
}
}
当上面的代码运行时,它会在line上产生错误obj.function(600851475143);
。为什么?