Question: Type in and run the following program. Then modify it to print Hello, name!, displaying the name that the user typed in. import javax.swing.JOptionPane; public
Type in and run the following program. Then modify it to print “Hello, name!”, displaying the name that the user typed in.
import javax.swing.JOptionPane;
public class DialogViewer
{
public static void main(String[] args)
{
String name = JOptionPane.showInputDialog("What is your name?");
System.out.println(name);
}
}
Step by Step Solution
3.45 Rating (158 Votes )
There are 3 Steps involved in it
The desired result could be achieved by concatenating Hello to the name and then again conce... View full answer
Get step-by-step solutions from verified subject matter experts
