List of usage examples for java.time MonthDay equals
@Override public boolean equals(Object obj)
From source file:Main.java
public static void main(String[] args) { MonthDay m = MonthDay.now(); System.out.println(m.equals(MonthDay.of(Month.APRIL, 1))); }
From source file:Main.java
public static void main(String[] argv) { LocalDate dateOfBirth = LocalDate.now(); MonthDay birthday = MonthDay.of(dateOfBirth.getMonth(), dateOfBirth.getDayOfMonth()); MonthDay currentMonthDay = MonthDay.from(LocalDate.now()); if (currentMonthDay.equals(birthday)) { System.out.println("Yes!!"); } else {/*ww w . j a v a 2 s .com*/ System.out.println("Sorry, today is not your birthday"); } }