我编码在Eclipse斐波纳契数列,这是我的代码 -Fibonacci序列错误
public class FibonacciAlgorithm {
private int a = 0;
private int b = 1;
public FibonacciAlgorithm() {
}
public int increment() {
int temp = b;
b = a + b;
a = temp;
return value;
}
public int getValue() {
return b;
}
}
它显示在return value;
行说value cannot be resolved to a variable
错误。我没有看到任何其他错误。
我现在看到了,我会将'value'定义为什么? – Hartja
你可能想要返回b。 –