下面的程序,可以通过调试,但是运行的时候却显示出的结果是:
Exception in thread "main" java.NoClassDefFoundError:A1/java
本人是想这个程序应该得到的结果是:Jinin d dfd
大家帮忙看下为什么会出现这种现象,应该更正,得到正确的结果,谢谢
public class A1
{ public static void main(String[] args)
{ Name name = new Name("Jinin",'d',"dfd");
System.out.println(name.getFullname());
}
}
class Name
{ private String firstname;
private char mi;
private String lastname;
public 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;
}
}