After (Date when)
Returns if and only if the moment represented by this Date object is later than the instant represented by the when true false .
before (Date when)
Returns if and only if the moment represented by this Date object is earlier than the instant represented by the when true false .
equals (Object obj)
Compares the equality of two dates. The result is only if and only if the argument null is not, and is an object that represents the same point in time (to milliseconds) as this object Date true .
Therefore, both objects are equal when and only if getTime Date the method returns the same value for two objects long .
Date1.after (Date2), when Date1 is greater than Date2, returns True when less than equals, returns false;
Date1.before (Date2), when Date1 is less than Date2, returns True when greater than equals returns false;
To verify that Date2 must be smaller than Date1 and not equal, use! Date1.after (DATE2)
Java.util.Date after and before, equal