阴影(VB.NET)和新之间的差异(C#) [英] Difference between Shadows (VB.NET) and New (C#)

查看:151
本文介绍了阴影(VB.NET)和新之间的差异(C#)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从一个头脑简单的简单问题:
哪些之间的差异在VB.NET阴影关键字和新建< /在C#code>关键字? (关于当然方法签名)。

Simple question from a simple-minded: What are the differences between the Shadows keyword in VB.NET and the New keyword in C#? (regarding method signatures of course).

推荐答案

他们是相同的。 阴影 是VB.NET相当于C#的的 关键字。它们的意思是一样的语义,它们向下编译到相同的IL。

They are identical. Shadows is the VB.NET equivalent for C#'s new keyword. They mean the same thing semantically and they compile down to the same IL.

在Visual Studio中的某些版本(我不知道这是否仍是如此),使用在VB.NET工程阴影关键字隐藏了所有的功能与智能感知名称相同的效果。但是,这实际上不是一个语言功能;如果它的设计还是在智能感知的实现中的错误它甚至没有明确。如果从C#应用程序使用同一个VB.NET库,你会看到所有的方法,如果他们用

In some versions of Visual Studio (I'm not sure if this is still the case), using the Shadows keyword in a VB.NET project had the effect of hiding all functions with the same name from Intellisense. But that's not actually a language feature; it's not even clear if it's by design or a bug in the implementation of Intellisense. If you use the same VB.NET library from a C# application, you'll see all of the methods as if they were declared with new.

这篇关于阴影(VB.NET)和新之间的差异(C#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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