public class Person{
public abstract void setName(String name);
public abstract void setAge(int age);
}

//interface ChildrenWorld{
//public void Study();
//}

//interface AdultWorld{
//public void Work();
  //}

class Children extends Person /*implements ChildrenWorld*/{
private String name;
private int age;
private String n;
public void setName(String name){
this.name = name;
System.out.println(this.name);
}
public void setAge(int age){
this.age = age;
System.out.println(this.age);
}
/*public char getName(String n){
return this.n;
}
public int getAge(int a){
return this.a;
}*/
protected void study(){
System.out.println("Go to School!");
}
private void playGame(String n){
System.out.println(this.n+"Say:I feel so happy when I play Game!");
}
/*default void exam(){
System.out.println("The exam is too important!");
}*/
}

class Adult extends Person/* implements AdultWorld*/{
private String name;
private int b;
public void setName(String name){
this.name = name;
System.out.println(this.name);
}
public void setAge(int b){
this.age = age;
System.out.println(this.age);
}
/*public char getName(String name){
return this.name;
}
public int getAge(int age){
return this.age;
}*/
public void work(){
System.out.println("I must complete the work today!");
}
public void payment(){
System.out.println("I have no payment!");
}
}

class Students extends Children{
//this.setName(String n);
//this.setAge(int a);
//this.study();
//this.playGames();
//this.exam();
//super.getName(String n);
//super.getAge(int a);
}

class Saler extends Adult{
private double x;
//this.setName(String n);
//this.setAge(int a);
//this.getName(String n);
//this.getAge(int a);
public void work(){
System.out.println("My work has compeleted!");
}
public double payment(double x){
return this.x;
}
}class Test{
public static void main(String[] args){
Children c1 = new Chilldren();
c1.setName("C1");
c1.setAge(10);
//System.out.println(c1.getName());
//System.out.println(c1.getAge());
c1.study();
c1.playGames(c1);
//c1.exam();
Student s1 = new Student();
s1.setName("S1");
s1.setAge(11);
//System.out.println(s1.getName());
//System.out.prinln(s1.getAge());
s1.study();
s1.playGames(s1);
//s1.exam();
Adult a1 = new Adult();
a1.setName("A1");
a1.setAge(29);
//System.out.println(a1.getName());
//System.out.prinln(a1.getAge());
a1.work();
a1.payment();
Saler s2 = new Saler();
s1.setName("S2");
a1.setAge(32);
//System.out.println(s2.getName());
//System.out.prinln(s2.getAge());
s2.work();
System.out.println(s2.payment(5000));

}
}
被注释的部分是我在调试的时候测试看是不是这些地方引起的原因,这段代码我编译之后很多错误,但我不知道错在哪里了
这是一次小作业,要求随意写一段程序,里面含有下列内容:super this extends abstract interface overwrite overload  private protected default
望高手指点迷津。。我初学JAVA。。