Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CalendarDate
- {
- private int year;
- private int month;
- private int day;
- public String toString()
- {
- String date = (this.year + "-" + this.month + "-" + this.day);
- return date;
- }
- // Takes information, checks for valid, throws exception for invalid
- public CalendarDate(int year, int month, int day)
- {
- if (day < 10)
- }
- public CalendarDate() // creates 2000-01-01
- public void setMonth(int newMonth) {} // check if valid, throw exception, change month
- public int getMonth() {}
- public String MDY_format() {}
- public void advanceDay() {}
- public boolean equals(CalendarDate other)
- {
- this.month == other.month;
- this.month == other.getMonth();
- }
- private static final = String[] monthLookup =
- {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
- monthLookup[month - 1];
- public static void main(String[] args)
- {
- CalendarDate day = new CalendarDate();
- System.out.println (day.toString());
- System.out.println (day);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement