2021年9月18日
摘要: 1 package com.bytezero.inherit3; 2 3 public class CylinderTest 4 { 5 public static void main(String[] args) 6 { 7 8 Cylinder cy = new Cylinder(); 9 cy 阅读全文
posted @ 2021-09-18 09:23 Bytezero! 阅读(40) 评论(0) 推荐(0)
摘要: 1 package com.bytezero.inherit2; 2 3 4 public class KidsTest 5 { 6 public static void main(String[] args) 7 { 8 Kids someKid = new Kids(12); 9 someKid 阅读全文
posted @ 2021-09-18 08:55 Bytezero! 阅读(73) 评论(0) 推荐(0)
摘要: 1 package com.bytezero.inherit; 2 3 /* 4 * 面向对象的特征二:继承性 5 * 6 * 一.继承性的好处: 7 * ①减少了代码的冗余,提供了代码的复用性 8 * ②便于功能的拓展 9 * ③为之后的多态性,提供了前提 10 * 11 * 12 * 二.继承性 阅读全文
posted @ 2021-09-18 08:25 Bytezero! 阅读(114) 评论(0) 推荐(0)