本文介绍了什么是继承的需要。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
最近我出现了面试和面试官问我一个问题,为什么要使用继承我们可以通过创建对象来实现同样的目标一个班级进入另一个班级,通过这样做,我们可以访问一个班级的所有方法到另一个班级。
如果有人知道确切答案我们有什么独特之处可以通过继承来实现,并且通过将对象一个类声明为另一个类是不可能的,然后是plz share
Hello,
Recently i was appear for an interview and interviewer ask me one question that Why to use Inheritance we can achieve the same thing by creating the object of one class into another class, and by doing so we can access all the methods of one class into another.
if any one know the exact answer that what unique thing we can achieve by Inheritance and which is not possible by declaring object one one class into another then plz share
推荐答案
这篇关于什么是继承的需要。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!