JAVA这个程序中-1是什么意思 我没看明白
importjava.util.*;publicclasscalendar2{publicstaticvoidmain(String[]args){GregorianCa...
import java.util.*;
public class calendar2
{
public static void main(String[] args)
{
GregorianCalendar gc=new GregorianCalendar();
final char[] kor_week={'日','一','二','三','四','五','六'};
for (int i=1990; i<=2020; i++)
{
gc.set(i, Calendar.DECEMBER, 28);
char week=kor_week[gc.get(Calendar.DAY_OF_WEEK)-1];
System.out.println(i+"年的生日是星期"+week);
}
}
} 展开
public class calendar2
{
public static void main(String[] args)
{
GregorianCalendar gc=new GregorianCalendar();
final char[] kor_week={'日','一','二','三','四','五','六'};
for (int i=1990; i<=2020; i++)
{
gc.set(i, Calendar.DECEMBER, 28);
char week=kor_week[gc.get(Calendar.DAY_OF_WEEK)-1];
System.out.println(i+"年的生日是星期"+week);
}
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询