diff --git a/examples/ch03/Fig03_13/NameDialog.java b/examples/ch03/Fig03_13/NameDialog.java index 8b3e2b9..2467314 100644 --- a/examples/ch03/Fig03_13/NameDialog.java +++ b/examples/ch03/Fig03_13/NameDialog.java @@ -7,11 +7,11 @@ public class NameDialog public static void main(String[] args) { // prompt user to enter name - String name = JOptionPane.showInputDialog("What is your name?"); + int age = JOptionPane.showInputDialog("What is your age?"); // create the message String message = - String.format("Welcome, %s, to Java Programming!", name); + String.format("Welcome, %d, to Java Programming!", age); // display the message to welcome the user by name JOptionPane.showMessageDialog(null, message);