Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Date {
- private int day;
- private int month;
- private int year;
- public Date() {
- }
- public Date(int day, int month, int year) {
- this.day = day;
- this.month = month;
- this.year = year;
- }
- public int getDay() {
- return this.day;
- }
- public int getMonth() {
- return this.month;
- }
- public int getYear() {
- return this.year;
- }
- public void setDay(int day) {
- day = enteredDay;
- }
- public void setMonth(int month) {
- month = enteredMonth;
- }
- public void setYear(int year) {
- year = enteredYear;
- }
- public String toString() {
- return getDay() + "/" + getMonth() + "/" + getYear();
- }
- public boolean isEarlier(Date) {
- if (enteredDay.getDay() < day) {
- return true;
- } else {
- return false;
- }
- }
Add Comment
Please, Sign In to add comment