李剛著《輕量級J2EE公司專屬應用程式實戰-Struts+Spring+Hibernate整合開發》的2處低級錯誤

來源:互聯網
上載者:User

原書第509頁的代碼

int punchHour=Calendar.getInstance().HOUR_OF_DAY

這樣是不對的,得出的punchHour是個常量,怎麼可能是當前的小時呢,下面的判斷毫無意義了,應該這樣

int punchHour=Calendar.getInstance().get(Calendar.HOUR_OF_DAY); 才對

李剛的書,這樣的低級錯誤,實在是遺憾、

 

還有一處錯誤,但錯誤比較明顯,是第507頁

其中應該是:

 if(Calendar.getInstance().get(Calendar.HOUR_OF_DAY)<11){
    a.setIsCome(true);
   }else{
    a.setIsCome(false);
   }

而不是

 if(Calendar.getInstance().get(Calendar.HOUR_OF_DAY)<11){  (此處按第一個錯誤修正)
    a.setIsCome(true);
   }   
  a.setIsCome(false);

如果按原書的寫法,那判斷Calendar.getInstance().get(Calendar.HOUR_OF_DAY)<11就沒有意義了

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.