什么是继承 继承的本质是对某一批类的抽象,从而实现对现实世界更好的建模。extends的意思是扩展,子类是父类的扩展。JAVA中只有单扩展,没有多扩展。object类super类方法重写 package com.oop.Demo05; //學生 人 父类 public class Person { public void say(){ System.out.println("说了一句话"); } } package com.oop.Demo05; //學生 is 人 派生类 子类 public class Student extends Person { } `` ```java package com.oop.Demo05; //Teacher is 人 public class Teacher extends Person{ } package com.oop.Demo05; import com.oop.Demo05.Student; public class Application { public static void main(String[] args) { Student student = new Student(); student.say(); } }