Uzyskaj dane wejściowe w Javie za pomocą Joptionpane

import javax.swing.JOptionPane;

public class Sample {
    public static void main(String[] args) {
        String name = "";
        name = JOptionPane.showInputDialog("Please Enter your name");
        String msg = "Hello " + name + "!";
        JOptionPane.showMessageDialog(null, msg);
    }
}
Fernandez, Jasmine M.