Subato

Date / earlier/later....

class Date{
  int day;
  int month;
  int year;

  Date(int day, int month, int year){
    this.day = day;
    this.month = month;
    this.year = year;
  }
  
  boolean isEarlierThan(Date that){
    return
         year<that.year
      || (year==that.year && month<that.month)
      || (year==that.year && month==that.month && day<that.day);
  }
  
  boolean isLaterThan(Date that){
    return that.isEarlierThan(this);
  }
  
  boolean isSameDate(Date that){
    return year==that.year &&month==that.month&&day==that.day;
  }
  public String toString(){
    return ""+day+"."+month+"."+year;
  }
  
  boolean isLeapYear(){
    return year%400==0
        ||(year%4==0 && year%100!=0);
  }
  int getAbsoluteDaysInYear(){
    return isLeapYear()?366:365;
  }
  public static void main(String[] args){
    Date d = new Date(30,11,2018);
    System.out.println(d);
  }
}