?? e375. determining the number of days in a month.txt
字號:
This example uses the Calendar class to determine the number of days in the month of a particular year.
// Create a calendar object of the desired month
Calendar cal = new GregorianCalendar(1999, Calendar.FEBRUARY, 1);
// Get the number of days in that month
int days = cal.getActualMaximum(Calendar.DAY_OF_MONTH); // 28
// Try month in a leap year
cal = new GregorianCalendar(2000, Calendar.FEBRUARY, 1);
days = cal.getActualMaximum(Calendar.DAY_OF_MONTH); // 29
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -