SHARE
TWEET

Untitled

a guest May 25th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class Date implements Comparable<Date>{
  2.     int month;
  3.     int day;
  4.     int year;
  5.     Date(int m, int d, int y){
  6.  
  7.     }
  8.  
  9.     @Override
  10.     public int compareTo(Date o) {
  11.         int yDelta = this.year - o.year;
  12.         int mDelta = this.month - o.month;
  13.         int dDelta = this.day - o.day;
  14.         return ((yDelta * 365) + (mDelta * 31) + dDelta);
  15.     }
  16. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top