'阴影'与'覆盖'在VB.NET [英] 'Shadows' vs. 'Overrides' in VB.NET

查看:300
本文介绍了'阴影'与'覆盖'在VB.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是两个关键词阴影和的Overrides ?他们做了什么和什么背景下是一个或另一个preferable?

What is the significance of the two keywords Shadows and Overrides? What they do and for which context is one or the other preferable?

推荐答案

我不会考虑阴影,真正成为一个面向对象的概念。覆盖表明您提供新的或额外的功能,它被应用于一个父类中定义的方法/属性等。阴影真的招数编译以为父方法/属性等根本不存在。

I wouldn't consider Shadows to really be an OOP concept. Overrides indicates that you are providing new or additional functionality for a method/property etc that was declared in an ancestor class. Shadows really tricks the compiler into thinking that the parent method/property etc does not even exist.

我有没有用阴影。坚持覆盖。这些类型的VB已经为多年来始终最终导致你解忧在某些时候有用的小特色。

I have no use for Shadows. Stick to Overrides. These types of helpful little "features" that VB has provided for years always end up causing you grief at some point.

这篇关于'阴影'与'覆盖'在VB.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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