Main Class:
package input;
public class InputTeast
{
public static void main(String[] args)
{
Input_P i = new Input_P();
i.inputPrint();
}
}
Input Class:
package input;
import javax.swing.JOptionPane; ///for show Dialog box you have to import this
public class Input_P
{
public void inputPrint()
{
String name = JOptionPane.showInputDialog(null,"Name: "); ///scan string,
JOptionPane.showMessageDialog(null,"Good Morning "+name+" !!!"); ///print
}
}
Output
input: sabit
output: Good Morning sabit
Add your comment