随笔分类 -  Java

为什么说接口能松耦合?
摘要:因为多态的特性,父类或者接口的引用是可以接受子类对象的。 比如: interface Test{} class Test1 implements Test{} class Test2 implements Test{} 上面声明一个Test接口,两个类Test1和Test2,分别实现Test接口。 阅读全文

posted @ 2018-01-10 18:18 会学习的猪 阅读(1173) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示