import java.util.*;
/*
* 1.获取任意年的二月有多少天 1.c.set(year,2,1) //某一年的3月1日 2.c.add(Calendar.DAY_OF_MONTH,-1) 往后退一天
* 2.获取昨天现在这个时刻 c.add(Calendar.DAY_OF_MONTH,-1) 往后退一天
* */
class Calendar对象
{
public static void sop(Object obj)
{
System.out.println(obj);
}
public static void main(String[] args)
{
Calendar c = Calendar.getInstance();
//c.set(2012,2,3);
c.add(Calendar.YEAR, 2);
printCalendar(c);
}
public static void printCalendar(Calendar c)
{
String mon[] = {"一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月",};
sop(c.get(Calendar.YEAR)+"年");
//sop(c.get(Calendar.MONTH)+1+"月");
int index = c.get(Calendar.MONTH);
sop(mon[index]);
sop(c.get(Calendar.DAY_OF_MONTH)+"日");
sop("星期"+(c.get(Calendar.DAY_OF_WEEK)-1));
}
}