前者是「is a」,後者則是「has a」的關係。近年來很多人提倡「favor composition over inheritance」,我也是支持者之一,但為何這樣,三言兩語又很難講清楚。
確定! 回上一頁