求大侠帮我编译一下这个程序,看要如何修改????
///创建一个抽象类///schoolname指学校名称
///classname指班级名称
///location指地址
///set是设置器,用来赋值给对象
///由于在这个类中存在抽象方法,所以这个类就是一个抽象类
abstract class school
{
String schoolname;
String classname;
String location;
public void setschoolname(String schoolname)//通过设置器来设置学校名称,班级名称
{ this.schoolname=schoolname; }
public void setclassname(String classname)
{ this.classname=classname; }
public String getschoolname()
{ return schoolname; }
public String getclassname()
{ return classname; }
abstract void setlocation(String location);
abstract String getlocation();
public String tostring()
{
String infor="学校名称:"+schoolname+";"+" "+"班级名称:"+classname;
return infor;
}
}
///创建一个学生类来继承这个抽象类,这个类中设置了学生姓名,学号
///性别、出生年月、家庭地址等参数。且使用设置器和访问器来编写它
///studentname指学生姓名
///studentcode指学生学号
///studentsexy指学生性别
///studentbithday指学生出生年月
///studentaddress指学生家庭地址
///set是类中的设置器
///get是类中的访问器
class student1 extends school
{
String studentname;
String studentcode;
String studentsexy;
String studentbirthday;
String studentaddress;
void setlocation(String location)
{ this.location=location; }
void getlocation()
{ return location; }
void setstudentname(String studentname)
{ this.studentname=studentname; }
void setstudentcode(String studentcode)
{ this.studentcode=studentcode; }
void setstudentsexy(String studentsexy)
{ this.studentsexy=studentsexy; }
void setstudentbirthday(String studentbirthday)
{ this.studentbirthday=studentbirthday; }
void setstudentaddress(String studentaddress)
{ this.studentaddress=studentaddress; }
String getstudentname()
{ return studentname; }
String getstudentcode()
{ return studentcode; }
String getstudentsexy()
{ return studentsexy; }
String getstudentbirthday()
{ return studentbirthday; }
String getstudentaddress()
{ return studentaddress; }
public String tostring()
{
String infor="super.tostring()+"学校地址"+location+"; "+"学生姓名"+studentname+";"+" "+"学号:"+studentcode+";"+" "+"性别:"+studentsexy+"; "+" "+"出生日期:"+studentbirthday+";"+" "+"家庭地址:"+studentaddress;
return infor;
}
}
///在这个类中,拥有抽象方法。所以这个类也是一个抽象类。同时也设置了姓名、
///学号、性别、出生年月、家庭地址的参数
///这个类是一个抽象的学生类
///studentname指学生姓名
///studentcode指学生学号
///studentsexy指学生性别
///studentbirthday指学生出生年月
///studentaddress指学生家庭地址
///set是类中的设置器
///get是类中的访问器
abstract class student2 extends school
{
String studentname;
String studentcode;
String studentsexy;
String studentbirthday;
String studentaddress;
abstract void setlocation(String location);
abstract String getlocation();
void setstudentname(String studentname)
{ this.studentname=studentname; }
void setstudentcode(String studentcode)
{ this.studentcode=studentcode; }
void setstudentsexy(String studentsexy)
{ this.studentsexy=studentsexy; }
void setstudentbirthday(String studentbirthday)
{ this.studentbirthday=studentbirthday; }
void setstudentaddress(String studentaddress)
{ this.studentaddress=studentaddress; }
String getstudentname()
{ return studentname; }
String getstudentcode()
{ return studentcode; }
String getstudentsexy()
{ return studentsexy; }
String getstudentbirthday()
{ return studentbirthday; }
String getstudentaddress()
{ return studentaddress; }
public String tostring()
{
String infor=super.tostring()+"学生姓名:"+studentname+"; "+"学号:"+studentcode+";"+"性别:"+studentsexy+";"+"出生年月:"+studentbirthday+";"+"家庭地址:"+studentaddress;
return infor;
}
}
///创建一个类来继承上面的一个抽象类,来实现那个抽象类中的抽象方法。这个类中无抽象方法,
///也没有声明为抽象类,这个类就不是抽象类
///这个类是一个抽象类的学生类
///studentname指学生姓名
///studentcode指学生学号
///studentsexy指学生性别
///studentbirthday指学生出生年月
///studentaddress指学生家庭地址
///set是类中的设置器
///get是类中的访问器
class student3 extends student2
{
void setlocation(String location)
{
this.location=location;
}
String getlocation()
{
return location;
}
public String tostring()
{
String infor=super.tostring()+"学校地址:"+location+";"+" ";
return infor;
}
}
///这是一个主运行类
///s1,s3是为学生类创建出来的两个不同的对象
///set指设置器
///通过tostring参数将对象中的参数一一以字符串形式输出
public class abstracttest
{
public static void main(String[] args)
{
student1 s1=new student1();
student3 s3=new student3();
s1.setschoolname("重庆大学");
s1.setclassname("计算机三班");
s1.setlocation("沙坪坝");
s1.setstudentname("王浩");
s1.setstudentcode("95012");
s1.setstudentsexy("男");
s1.setstudentbirthday("1976-07-14");
s1.setstudentaddress("重庆市解放碑");
s3.setschoolname("四川大学");
s3.setclassname("机械系一班");
s3.setlocation("成都市");
s3.setstudentname("董洁");
s3.setstudentcode("33012");
s3.setstudentsexy("女");
s3.setstudentbirthday("1974-08-21");
s3.setstudentaddress("成都市区");
System.out.println(s1.tostring());
System.out.println(s3.tostring());
}
}