Compare two Java Date objects using before method example
import java.util.Date;
publicclass Main {
publicstaticvoid main(String[] args) {
Date d1 = new Date();
Date d2 = new Date();
System.out.println("First Date : " + d1);
System.out.println("Second Date : " + d2);
System.out.println("Is first date before second ? : " + d1.before(d2));
}
}