//***************************************************** // Application HappyBirthdayToYou reads in a name // and prints a message saying Happy Birthday followed // by the name. //***************************************************** import java.io.*; public class HappyBirthdayToYou { static class BirthdayName { String enteredName; } public void getName() throws IOException { BufferedReader inData; inData = new BufferedReader(new InputStreamReader(System.in)); System.out.println("Please enter your name: "); enteredName = inData.readLine(); } public void printMessage() { System.out.println("Happy Birthday, " + enteredName); } public static void main(String[] args) throws IOException { BirthdayName birthday; birthday = new BirthdayName(); birthday.getName(); birthday.printMessage(); } }