Welcome to the World of Online Learning:
Hello Friends “This blog helps you to learn Java programming concepts. You can learn Java language at your own speed and time. One can learn concepts of Java language by practicing various programs given on various pages of this blog. Enjoy the power of Self-learning using the Internet.”

Write a Java Program to Check the birthday and print Happy Birthday message
PROGRAM: Java Program to Check the birthday and print Happy Birthday message
/*Java Program to Check the birthday and print Happy Birthday message*/
import java.time.LocalDate;
import java.time.Month;
public class Main {
public static void main(String args[]) {
// declare variables for birthday
int birthDate = 23;
Month birthMonth = Month.SEPTEMBER;
// get current date
LocalDate currentDate = LocalDate.now();
System.out.println(“Todays Date: ” + currentDate);
// get current date and month
int date = currentDate.getDayOfMonth();
Month month = currentDate.getMonth();
if(date == birthDate && month == birthMonth) {
System.out.println(“HAPPY BIRTHDAY TO YOU !!”);
}
else {
System.out.println(“Today is not my birthday.”);
}
}
}