Console Input

Objective #1: Read program input using the Scanner class.

Objective #2: Read input from an external file or web page.

Objective #3: Obtain input from the user with the showInputDialog method.

import javax.swing.JOptionPane;

public class Junk
{
   public static void main(String[] args)
   {
      String name = JOptionPane.showInputDialog("enter your name");
      JOptionPane.showMessageDialog(null, "Goodbye " + name);
   }
}