类继承和接口继承有什么区别?以上哪一项会产生较低的耦合性和较高的内聚力。
发布于 2016-12-11 21:49:39
类继承更像是is a,所以Square是Shape,而接口更像has the ability of,所以Square具有Resizable的能力。但正如您所说,您可以使用接口继承来耦合多个功能。
is a
Square
Shape
has the ability of
Resizable
https://stackoverflow.com/questions/41086805
相似问题