To answer this question, you may need to look up
JOptionPane’s showInputDialogand
showConfirmDialogmethods on Oracle’s Java API website. What does this program do?
import javax.swing.JOptionPane;public class UncertainHello{ public static void main(String[] args) { String name; int response; do { name = JOptionPane.showInputDialog("What’s your name? "); response = JOptionPane.showConfirmDialog(null, "Are you sure?"); if (response == JOptionPane.NO_OPTION) { name = "there"; break; } } while (response == JOptionPane.CANCEL_OPTION); System.out.println("Hello " + name); } // end main} // end class UncertainHello
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.