public class Test15 {
 public static void main(String[]args) {
  Student1 s = new Student1("zhangsan",20,"beijing");
  System.out.print(s.talk());
 }
}

abstract class Person4 {
 String name;
 int age;
 String occuption;
 public abstract String talk();
}
class Student1 extends Person4 {
 public Student1(String name,int age,String occuption) {
  super.name = name;
  this.age = age;
  this.occuption = occuption;
 }
 public String talk() {
  return"Name: "+this.name+"; Age: "+super.age+"; Occuption: "+occuption;
 }
}

posted on 2013-03-25 20:05  翻滚的小豆哥  阅读(159)  评论(0编辑  收藏  举报