I am just a beginner with programming and it's my first time using two classes and it just won't compile can someone help please?
import javax.swing.JOptionPane;
class person{
String name;
int age;
public void person(String n, int a){
name = n;
age = a ;
}
public String getDetails(){
return name +" ("+age+")";
}
}
public class sortperson
{
public static void main(String[] args)
{
String m = JOptionPane.showInputDialog(null, "Enter a Name: ");
String s = JOptionPane.showInputDialog(null, "Enter an Age: ");
int g = Integer.parseInt(s);
person p = new person(m,g);
JOptionPane.showMessageDialog(null, "Your Person is" +p);
System.exit(0);
}
}
sortperson.java:22: cannot find symbol
symbol : constructor person(java.lang.String,int)
location: class person
person p = new person(m,g);
^
1 error