Using static variables and static methods to implement the class Fibonacci such that
the first call to Fibonacci.next()
returns 2, the second returns 3, and then 5, and so on.
示意圖:
variable number1, number2 are static.(記憶體位置固定)
variable Ans are not static.(記憶體位置非固定)
class
main
沒有留言:
張貼留言