源码?
String[] weeks = {"星期日","星期一","星期二","星期三","星期四","星期五","星期六"};
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
System.out.println(cal.get(Calendar.DAY_OF_WEEK));
int week_index = cal.get(Calendar.DAY_OF_WEEK) - 1;
if(week_index<0){
week_index = 0;
}
System.out.println(weeks[week_index]);
输出的结果如下: