Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/ch03/Fig03_13/NameDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down