2008年11月21日 星期五

lab class definition 2

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.month);and see what happens. Why?



month被定義為def=>private(只有自己才可以呼叫),因此無法在defDemo呼叫他











沒有留言: