在jcreator中遇到的问题,请高手赐教
代码1-----------------
package people;
public class people{
public people (String name){
......
}
public people(String name, String sex){
......
}
public String getName(){
return name;
}
public String getSex(){
return sex;
}
private String name;
private String sex;
}
代码2---------------------
package people;
import people.people;
public class chinese extends people{
public chinese(String aName,String aSex){
super(aName,aSex);
}
public chinese(String aName,String aSex, int aAge){
super(aName, aSex);
age = aAge;
}
public void getPersonalInformation(){
System.out.print("name is :" + super.getName() +"\n" + "age is:" + age);
if (super.getSex() == "female")
System.out.println("she is a female");
else
System.out.println("he is a male");
}
private int age;
}
代码3------------------------
import people.*;
public class testpeople{
public static void main(String [] args){
chinese ren_1 = new chinese("beidou", "boy", 21);
System.out.println(ren_1.getPersonalInformation());
}
}
编译代码3的时候,出现一下错误:
F:\Testfield\people\testpeople.java:5: cannot access chinese
bad class file: F:\Testfield\people\chinese.java
file does not contain class chinese
Please remove or make sure it appears in the correct subdirectory of the classpath.
chinese ren_1 = new chinese("zhangyu", "boy", 21);
请高手指教,谢谢!