Java进阶-is-a、is-like-a、has-a 发表于 2020-02-22 | 分类于 Java | 字数统计: 78 字 | 阅读时长 ≈ 1 分钟 is-a:泛化 is-like-a:实现 has-a:关联 is-a123456public class Animal{ public void method1(); }public classDog extends Animal { // Dog is a Animal} is-like-a12345678public interface I{ public void method1(); } public classA implements I{ // A is like a I; public void method1(){ // 实现 } } has-a12345public class A { // A has a B; private B b;}public class B{}