< Calenadr >
public class Test02_Calendar {
public static void main(String[] args) {
Calendar c=Calendar.getInstance();
System.out.println(c);
//c.set(2020, 0,1);//2020년 1월 1일로 설정
c.set(Calendar.DAY_OF_MONTH,20); //특정 필드값 변경 -> 날짜를 20일로 설정
c.add(Calendar.DAY_OF_WEEK,20);//날짜에 20일 더하기
System.out.println(c);
int y=c.get(Calendar.YEAR);
int m=c.get(Calendar.MONTH) + 1;
int d=c.get(Calendar.DAY_OF_MONTH);
System.out.println( y+"년" + m +"월" + d +"일");
}
}