Code for Birthday
Hello everyone, I just like to write code ,that will print "Happy birth day to you". Can anyone find the problem here? if i write if(today.equals(today)) then it write, what i want.But I would like to compare today with birthday. import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class test { @SuppressWarnings("unlikely-arg-type") public static void main(String[] args) throws ParseException { Date today=new Date(); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yy"); Date birthday = sdf.parse("03-10-18"); //System.out.println(sdf.format(today)); if(today.equals(birthday)) { System.out.println("Happy birthday to you!!<3"); } } }