类继承与接口继承

时间:2016-12-11 13:43:08

标签: theory metrics code-metrics

Class继承和Interface继承有什么区别?以上是什么产生较低的耦合和较高的内聚力。

1 个答案:

答案 0 :(得分:0)

类继承更多地是$grid.on('layoutComplete', function(event,items){// when the layout completes $('.grid .grid-item')// get all grid-items .css("opacity", "1")// reset their opacity .filter(function() {// filter to return return $(this).css('top') == '0px'; // the items with a top of 0 }) .css("opacity", "0.5");//set the opacity of the matched items }); ,因此is aSquare而接口更多是Shape,因此has the ability of具有Square的能力{1}}。但正如你所说,你可以使用接口继承来结合多种能力。