2007年12月28日 星期五

Lab Static Method

Study Display 5.2.
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

沒有留言: