java程序的日历编程代码?
公共静态void main(String[] args) {
calendar calendar = calendar . getinstance();
calendar.set(日历。年,2065 438+02);
calendar.set(日历。月,1);
calendar.set(日历。月日,1);
int first = calendar.get(Calendar。星期几)-1;
系统。out . println(calendar . get(calendar . year)+" year "
+(calendar . get(calendar . month)+1)+"月历");
system . out . println(" Day \ t1 \ T2 \ T3 \ T4 \ t5 \ T6 ");
for(int I = 0;我& lt第一;i++) {
system . out . print(" \ t ");
}
int maxDay = Calendar . getactualmaximum(Calendar。月日);
for(int I = 0;我& ltmaxDayi++) {
if (first / 7 == 1) {
first = 0;
system . out . println();
}
System.out.print(i + 1
+(first/6 = = 1 | | I = = maxDay-1?" ":" \ t "));
第一个++;
}
}