package ch10;
public class BirthDay {
private int day;
private int month;
private int year;
private boolean isValid;
public int getDay() {
return day;
}
public void setDay(int day) {
this.day = day;
}
public int getMonth() {
return month;
}
public void setMonth(int month) {
this.month = month;
}
public int getYear() {
return year;
}
public void setYear(int year) {
this.year = year;
}
public void showDate() {
if(isValid) {
System.out.println( year + "년 " + month + "월 " + day + "일 입니다.");
}else {
System.out.println("유효하지 않는 날짜입니다.");
}
}
}
package ch10;
public class BirthDayTest {
public static void main(String[] args) {
BirthDay date = new BirthDay();
date.setYear(2019);
date.setMonth(12);
date.setDay(30);
date.showDate();
}
}
2019년 12월 30일 입니다.
처음 강의를 보고 있을땐 정말 1도 이해가 안됐었는데,
다시 한번 찬찬히 코딩을 쳐보니 아주 조~금은 이해가 되가고 있다. 아주 조금..^^
선생님이 말씀하시는 내용을 그때그때 깨닫게 되는 날이 빨리 오기를~