静态方法 [英] static methods

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

问题描述

这是真的你在VB.NET中没有静态方法吗?

Public Static Sub Initialize() - ???


谢谢

Mark

Is that true you can''t have a static method in VB.NET?
Public Static Sub Initialize() -- ???

thanks
Mark

推荐答案

您使用关键字''Shared'',但它具有相同的效果。


所以你可以有一个静态方法,你可以在函数声明中放入没有静态关键字的




" Mark" <马** @ discussions.microsoft.com>在留言中写道

新闻:A7 ********************************** @ microsof t.com ...
You use the keyword ''Shared'', but it has the same effect.

So you can have a static method, there is just no static keyword that you
can put in the function declaration.

"Mark" <Ma**@discussions.microsoft.com> wrote in message
news:A7**********************************@microsof t.com...
这是真的你在VB.NET中没有静态方法吗?
Public Static Sub Initialize() - ???

感谢
Mark
Is that true you can''t have a static method in VB.NET?
Public Static Sub Initialize() -- ???

thanks
Mark



Mark,


Visual Basic与之无关来自C的旧遗产名称。


因此,有一个名称用于更好地描述这一点。


Public Shared Sub等


我希望这会有所帮助,


Cor


" Mark" <马** @ discussions.microsoft.com> schreef in bericht

新闻:A7 ********************************** @ microsof t.com ...
Mark,

Visual basic had not to do with old legacy names from C.

Therefore is there a name used which describes this better.

Public Shared Sub etc.

I hope this helps,

Cor

"Mark" <Ma**@discussions.microsoft.com> schreef in bericht
news:A7**********************************@microsof t.com...
这是真的你在VB.NET中没有静态方法吗?
Public Static Sub Initialize() - ???

感谢
马克
Is that true you can''t have a static method in VB.NET?
Public Static Sub Initialize() -- ???

thanks
Mark



谢谢!


Mark


" Cor Ligthert [MVP]"写道:
Thanks!

Mark

"Cor Ligthert [MVP]" wrote:
Mark,

Visual Basic与C中的旧遗留名称无关。

因此有一个名字用来描述这个更好。

Public Shared Sub等

我希望这会有所帮助,

Cor

;马克" <马** @ discussions.microsoft.com> schreef在bericht
新闻:A7 ********************************** @ microsof t.com。 ..
Mark,

Visual basic had not to do with old legacy names from C.

Therefore is there a name used which describes this better.

Public Shared Sub etc.

I hope this helps,

Cor

"Mark" <Ma**@discussions.microsoft.com> schreef in bericht
news:A7**********************************@microsof t.com...
这是真的你在VB.NET中没有静态方法吗?
Public Static Sub Initialize() - ???

谢谢
马克
Is that true you can''t have a static method in VB.NET?
Public Static Sub Initialize() -- ???

thanks
Mark




这篇关于静态方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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