本文介紹了是否需要調(diào)用 Java 的 Calendar.getTime() 來更新對象?的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
限時送ChatGPT賬號..
我在一些 java 代碼中看到一條注釋,指出需要調(diào)用 getTime()
來更新 Calendar
對象.這是真的?我找不到任何說這是必要的.
I came across a comment in some java code that states that getTime()
needs to be called to update the Calendar
object. Is this true? I cannot find anything that says that this is necessary.
代碼如下:
Calendar cal = new GregorianCalendar();
cal.setFirstDayOfWeek(Calendar.SUNDAY);
cal.set(2009, 9 - 1, 10, 2, 30);
// Get Time needs to be called to update the Calendar object
cal.getTime();
推薦答案
不,這不是真的.
這篇關(guān)于是否需要調(diào)用 Java 的 Calendar.getTime() 來更新對象?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!