You are on page 1of 1

import javax.swing.

*;
public class blah {

public static void main(String[] args)


{
// declaring and initializing variables

String name = " ", gender = " ";


int age;

name = JOptionPane.showInputDialog("Enter name:");


gender = JOptionPane.showInputDialog("Enter gender:");
age = Integer.parseInt(JOptionPane.showInputDialog("Enter
age:"));
// need to parse for age kay String lng si JOptionPane

JOptionPane.showMessageDialog(null, "Your name is: " + name +


"\n"
+ "You are a
" + gender + "\n"
+ "You
are " + age );

System.out.print("Your name is: " + name);

You might also like