虚拟覆盖? [英] virtual override ?

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

问题描述

为什么我们使用虚拟和覆盖而不使用this

why we use virtual and overrride we do this without using this

推荐答案

,您现在应该可以找到Wiki.还有google,一个了不起的搜索引擎,可以帮助您立即获得答案.

这不是发布您所有作业问题的论坛.如果解决这些问题已经很困难,那么您真的应该考虑选择其他专业,因为这不会变得容易得多.

祝你好运!
You should be able to find the wiki by now. There is also google, an amazing search engine that can help getting answer in no time.

This is not a forum for posting all your homework questions. If solving these questions is already to hard you really should consider choosing another profession because it won''t get much easier.

Good luck!


virtual关键字使一个类可以被覆盖.如果必须防止覆盖它,则需要使用sealed关键字.如果未使用关键字virtual,则甚至可以覆盖该类的成员.但是,建议使用它来使代码有意义.


overlay关键字用于覆盖基类中的虚拟方法. Abstract关键字用于修改类,方法或属性声明.您不能实例化抽象类或直接调用抽象方法.
The virtual keyword enables a class to be overridden. If it has to be prevented from being overridden, then the sealed keyword needs to be used. If the keyword virtual is not used, members of the class can even then be overridden. However, its usage is advised for making the code meaningful.


The override keyword is used to override the virtual method in the base class. Abstract keyword is used to modify a class, method or property declaration. You cannot instantiate an abstract class or make calls to an abstract method directly.


这篇关于虚拟覆盖?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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