Traditional Culture Encyclopedia - Almanac inquiry - Calendar programming code of java program?
Calendar programming code of java program?
Public static void main(String[] args) {
calendar calendar = calendar . getinstance();
Calendar.set (calendar year, 2012);
Calendar.set (calendar month,1);
Calendar.set (calendar month and day,1);
Int first = calendar.get (calendar. Day of the week)-1;
System. out . println(calendar . get(calendar . year)+“year“
+(calendar.get (calendar.month)+1)+"calendar");
system . out . println(“Day \ t 1 \ T2 \ T3 \ T4 \ t5 \ T6“);
for(int I = 0; I'm < first; i++) {
system . out . print(“\ t“);
}
int maxDay = Calendar . getactualmaximum(Calendar。 Month day);
for(int I = 0; I & ltmaxdayi++)
if(first/7 = = 1 ){
first = 0;
system . out . println();
}
system . out . print(I+ 1
+(first/6 = = 1 | | I = = maxDay- 1? ““:“\ t“));
The first++;
}
}
- Related articles
- The Origin and Significance of Mother's Day: What should I give my mother-in-law on Mother's Day?
- The omen of dreaming that the golden toad is next to the big fish
- Destroy! Destroy! It broke ground! ! !
- How many red, white and wide stripes are there on the American flag?
- Query on the life span of the zodiac in the yellow calendar
- 202 1 the eleventh day of the first month is open for business, shall we open for business?
- What day is the lunar calendar tomorrow?
- Is 202 1 beginning of spring solar term suitable for grave repair? Twenty-four solar terms jingle daquan
- China's authentic almanac is accurate.
- How to add 6 9 1 Gregorian calendar weather to mobile phone desktop?