本帖最后由 明锦添 于 2013-4-19 14:28 编辑
public class QiTaDuiXiang
{
public static void main(String[] args)
{
Calendar c=Calendar.getInstance();
sop(c.get(Calendar.YEAR));
我想在这里取到myMonth和myWeek然后输出
}
public void myCalendar(Calendar c)
{
String[] month={ "一月","二月","三月","四月","五月",
"六月","七月","八月","九月","十月","十一月","十二月"};
String[] weeks={"星期一","星期二","星期二","星期三","星期四","星期五"
,"星期六","星期日"};
int index1=c.get(Calendar.MONTH);
int index2=c.get(Calendar.DAY_OF_WEEK);
String myMonth=month[index1];
String myWeek=weeks[index2];
}
public static void sop(Object o)
{
System.out.println(o);
}
}
|