java中继承的缺点 [英] disadvantages of inheritance in java

查看:74
本文介绍了java中继承的缺点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以解释java中继承的缺点

Can anyone explain disadvantage of inheritance in java

推荐答案

你可能想读:

Effective Java™,Second Edition
作者:Joshua Bloch

Effective Java™, Second Edition By: Joshua Bloch

第4章类和接口

项目16:偏好继承的构成

Item 16: Favor composition over inheritance

项目17:继承的设计和文档,否则禁止它

Item 17: Design and document for inheritance or else prohibit it

第18项:首选接口到抽象类

Item 18: Prefer interfaces to abstract classes

这篇关于java中继承的缺点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆