csharp编程语言 [英] csharp programming language

查看:267
本文介绍了csharp编程语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以问一个在c-sharp中实现继承的示例代码程序吗?请解释什么是继承,多态,重写和抽象类.. tnx ..任何答复将不胜感激...

can i ask a sample code program in c-sharp wherein inheritance was implemented? kindly explain what is inheritance, polymorphism, overriding and abstract classes.. tnx.. any reply will be appreciated very much...

推荐答案


如果您要张贴作业,至少要使其看起来像您自己尝试做某事!

我们不做您的作业:这是有原因的.在这里,您可以考虑自己被告知的内容,并尝试理解它.也可以在那里帮助您的导师识别您的弱点,并将更多的注意力放在补救措施上.

但是:
If you are going to post your homework, at least try to make it look like you have attempted to do something yourself!

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

However:
public class A
   {
   public string Name {get; set;}
   pubic A ()
      {
      }
   }
public class B : A
   {
   public string Address {get; set;}
   public B ()
      {
      }
   }

有一个从类A继承的类B.这意味着B既包含名称(从A继承),又包含地址(特定于B).
对于所有其他内容,请参阅您的课程笔记或Google.

There is a class B which inherits from the class A. This means that B contains both a Name (inherited from A) and an Address (specific to B).
For all the rest, see your course notes, or Google.


这篇关于csharp编程语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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