为什么我这个程序运行的时候有异常?
/*java.lang.NoSuchMethodError: main
Exception in thread "main"
Process completed.*/
//why so many Exception
public class MyFather
{
public static void mian(String[] args)throws Exception
{
Person me=new Person(new Name("moon","su"),'M');
Person fa=new Person(new Name("yekui","su"),'M');
Person gp=new Person(new Name("zhenhuai","su"), 'M');
me.setFather(fa);
fa.setFather(gp);
System.out.println(me);
System.out.println(fa);
System.out.println(gp);
}
}
class Person
{
Person(Name name, char sex)
{
this.name=name;
this.sex=sex;
}
Name name()
{
return name;
}
void setFather(Person father )
{
this.father=father;
}
public String toSting()
{
return new String(""+father+"'s father"+this.father);
}
protected Name name;
protected char sex;
//protected String id;
//protected Person mother;
protected Person father;
}
class Name
{
Name(String first, String last)
{
this.first=first;
this.last=last;
}
String first()
{
return first;
}
String last()
{
return last;
}
private String first;
private String last;
}
------解决方法--------------------------------------------------------