Greeter
Goal:
Print a global greeting to the console. Then use input and message dialogs to join Strings and send the user a friendly greeting!
Steps:
- Create a new class called Greeter.
- Add a main method. Eclipse has a helpful schortcut - main
- Print "Hello World!" to the console. Eclipse has a helpful schortcut - syso
- Now ask the user for their name. The code looks like this:
String input = JOptionPane.showInputDialog("What is your name?");
- Join their name to the end of this greeting. The code looks like this.
JOptionPane.showMessageDialog(null,"Hello "+input);