java编程中出现 找不到符号的问题

来源:百度知道 编辑:UC知道 时间:2024/05/24 13:14:43
class Person
{
protected String name,sex,city;
protected int age;
public Person(String n,String s,String c,int a)//超类的构造方法
{
this.name=n; this.sex=s; this.city=c; this.age=a;
}
public void ShowInfo()
{
System.out.print("姓名\t"+name+"\t");
System.out.print("年龄\t"+age+"\t");
System.out.print("性别\t"+sex+"\t");
System.out.print("城市\t"+city+"\t");
}
}

class Student extends Person
{
int num,eglish,maths,computer; String dept;//添加子类成员
Student(String n,String s,String c,String d,int nu,int a,int e,int m,int co)
{ super(n,s,c,a);
num=nu; dept=d; eglish=e; maths=m; computer=co;
}
int ave()
{
int av=(eglish+maths+computer)/3;
return av;
}
public void ShowInfo()
{
super.ShowInfo();
System

赶紧下个 Eclipse 来编辑你的JAVA吧,这种低级的错误就不会出现了!

给你个下载地址:
http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/ganymede/SR1/eclipse-java-ganymede-SR1-win32.zip

可能是调用出了问题,有可能文件不在同一包下

另外,麻烦值对象写get() set()方法,这样写很容易出错的

括号...帅哥!!