帮忙下看程序错在哪里,红色的有错,还请大家指教下,说明为什么错,先谢谢大家了
public class Name
{ private String firstname;
private char mi;
private String lastname;
public Name()
{ this ("Jill",'s',"Barr");
}
public String Name(String firstname,char mi,String lastname)
{ this.firstname = firstname;
this.mi = mi;
this.lastname = lastname;
}
public String getFirstname()
{ return firstname;
}
public void setFirstname(String firstname)
{ this.firstname = firstname;
}
public char getMi()
{ return mi;
}
public void setMi(char mi)
{ this.mi = mi;
}
public String getLastname()
{ return lastname;
}
public void setLastname(String lastname)
{ this.lastname = lastname;
}
public String getFullname()
{ return firstname + ' ' + mi + ' ' + lastname;
}
}
public class A1
{ public static void main(String[] args)
{ Name name = new Name("John",'D',"Smith");
System.out.println(name);
}
}