什么是继承的需要。 [英] What is the Need of Inheritance.

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

问题描述

您好,



最近我出现了面试和面试官问我一个问题,为什么要使用继承我们可以通过创建对象来实现同样的目标一个班级进入另一个班级,通过这样做,我们可以访问一个班级的所有方法到另一个班级。



如果有人知道确切答案我们有什么独特之处可以通过继承来实现,并且通过将对象一个类声明为另一个类是不可能的,然后是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

推荐答案

这里有几篇文章:



何时使用继承 - MSDN - Microsoft Developer Network [ ^ ]



为什么继承im编程中的portant? [ ^ ]



继承介绍,C#中的多态性 [ ^ ]



Composition VS Inheritance [ ^ ]



更多信息可通过Google搜索找到。
Here are a couple of articles:

When to Use Inheritance - MSDN – the Microsoft Developer Network‎[^]

Why is inheritance important in programming?[^]

Introduction to inheritance, polymorphism in C#[^]

Composition VS Inheritance[^]

More can be found via Google search.


这篇关于什么是继承的需要。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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