本帖最后由 王广亚 于 2013-9-13 14:42 编辑
- package bijicaogao;
- import java.util.Calendar;
- public class ThreadDemo
- {
- public static void main(String[] args)
- {
- Calendar c=Calendar.getInstance();
- String[] mons={"一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"};
- String[] weak={"","星期日","星期一","星期二","星期三","星期四","星期五","星期六"};
-
- sop(c.get(Calendar.YEAR));
- sop(mons[c.get(Calendar.MONTH)]);
- sop(c.get(Calendar.DAY_OF_MONTH));
- sop(weak[Calendar.DAY_OF_WEEK]);//今天是周五哎。什么原因,代码错了?不可能吧
- sop(Calendar.DAY_OF_WEEK);
-
- }
- public static <T> void sop(T t){
- System.out.println(t);
- }
- }
复制代码 |