最近在学习golang的过程中,发现golang抛弃了inheritance,仅支持composition。为了弄清楚两者的优缺点,翻阅了很多材料,发现下面两篇文章写得不错,有兴趣的tx可以读一读: http://www.javaworld.com/article/2076814/core-java/inheritance-versus-composition--which-one-should-you-choose-.html http://www.javaworld.com/article/2076841/core-java/designing-with-interfaces.html