package javacom.aa;
import java.util.*;
import java.text.*;
public class Person{
public String ID ;
public String name;
public String sex;
public Date birthday;
public Person(String IID,String Iname,String Isex, Date Ibirthday)
{ this.ID=IID;
this.name=Iname;
this.sex=Isex;
this.birthday=Ibirthday;
}
public String getID(){
return ID;}
public String getName(){
return name;}
public Date getBirthday(){
return birthday;}
public int getAge(){
Calendar now=Calendar.getInstance();
int currentyear=now.get(Calendar.YEAR);
SimpleDateFormat fmt=new SimpleDateFormat("yyyy");
int birthyear=Integer.parseInt(fmt.format(birthday));
return (currentyear-birthyear+1);
}
}
package javacom.aa;
import java.util.*;
import javacom.aa.Person;
public class Student extends Person{
public String Sno;
public String Department;
public Date Enrollmentdate;
public Student(String IID,String Iname,String Isex,
Date Ibirthday,String ISno,String IDepartment,Date IEnrollmentdate)
{super(IID,Iname,Isex,Ibirthday);
this.Sno=ISno;
this.Department=IDepartment;
this.Enrollmentdate=IEnrollmentdate;
}
}
person编译已生成类文件,但编译student .java 文件时去出现这种情况:
E:\javacom\aa>javac student.java
student.java:3: cannot find symbol
symbol : class Person
location: package javacom.aa
import javacom.aa.Person;
^
student.java:4: cannot find symbol
symbol: class Person
public class Student extends Person{
^
2 errors
请教一下怎样解决这个问题。。。
是不是那个classpath 路径有问题啊,但我已经设了那个路径了。。。。。
如何解决以下java中can not find symbol的问题