首页 > TAG信息列表 > 自父

继承

语法:class 子类 extends 父类{} //定义子类时,显示继承父类 package com.qf.day13.t1.inherit; public class TestExtends { public static void main(String[] args) { Dog dog1 = new Dog(); dog1.breed = "哈士奇"; //继承自父类 dog1.a