2007年11月16日 星期五

lab class definition

Study Display 4.1 and then do Self-Test Exercise 1.

1.Write a method called "makeItNewYears" that could be added to the class DateFirstTry in Display 4.1. The medthod "makeItNewYears" has no parameters and sets the month instance variable to "January" and the day instance variable to 1. It does not change the year instance variable.

1.紅色框框是新加入的 methods named "makeItNewYears"















2.紅色框框內表示使用新加入的 method();
















3.最後程式的執行結果

沒有留言: