2009年3月30日 星期一

Lab 15 : class definition 2

Study Display 4.4 (2nd ed. and 3rd ed.) or Display 4.2 & Display 4.3 (1st ed.) and then
1. Comment out date.setDate(6, 17, year); by
// date.setDate(6, 17, year);
2. At the next line below, add date.readInput();
3. Run the program again. Fix any problems you may encouter along the way
.
4. At the last line of your program, add System.out.println(date.mon
th);
and see what happens. Why?

因為month在DateThirdTry.java使用private的宣告,所以受到保護僅限在該Class使用。

沒有留言:

張貼留言