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 路径有问题啊,但我已经设了那个路径了。。。。。
----------------解决方案--------------------------------------------------------
你的编译器不是已经很清楚的告诉你了吗?
----------------解决方案--------------------------------------------------------
我知道编译器讲什么,但我不知道怎样改啊?要是怎样知道,我也不会求助了。老兄,我是个初学者啊,不要卖关子了,好不好,知道就直说啦。。。。。
----------------解决方案--------------------------------------------------------