C#中的可选参数??? [英] Optional argument in C# ???

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

问题描述



我想知道是否存在类似于可选参数的内容

VB for C#???

thanx ...

解决方案

tiger79< po ** @ freemail.nl>写道:

我想知道是否存在类似于VB中的可选参数的C#???




不,C#不支持可选参数。


-

Jon Skeet - < sk *** @ pobox.com>
http://www.pobox.com/~skeet

如果回复小组,请不要给我发邮件




我也想了解收藏品作为一种类型。

似乎无法在C3中找到一个,我确实找到了ArrayList,我想这可以是

用作VB中的集合? ?


关于可选参数,我确实发现没有这样的东西,但是

并不存在类似的东西???? br />

Thanx ......


" tiger79" < PO ** @ freemail.nl>在消息中写道

新闻:Oa ************** @ tk2msftngp13.phx.gbl ...

我想知道是否存在类似于VB中的可选参数
for C#???
thanx ...



" tiger79" < PO ** @ freemail.nl>在消息中写道

新闻:OF ************** @ TK2MSFTNGP11.phx.gbl ...

关于可选参数,我确实发现没有这样的东西,
但是没有类似的东西存在???




重载 - 同样的功能名字,不同的论点。例如


函数testFunc()

{


{


函数testFunc(string strTest)

{


}

函数testFunc(string strTest,int intTest)

{


}


Hi,
I would like to know if there exists something like the Optional argument in
VB for C# ???
thanx...

解决方案

tiger79 <po**@freemail.nl> wrote:

I would like to know if there exists something like the Optional argument in
VB for C# ???



No, C# doesn''t support optional arguments.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too



I''d also like to know about the Collection as a type.
Can''t seem to find one in C3, I did find the ArrayList, i guess this can be
used as a Collection in VB ???

About the optional argument, I did find out that there is no such thing, but
doesn''t something similar exist ???

Thanx...

"tiger79" <po**@freemail.nl> wrote in message
news:Oa**************@tk2msftngp13.phx.gbl...

Hi,
I would like to know if there exists something like the Optional argument in VB for C# ???
thanx...



"tiger79" <po**@freemail.nl> wrote in message
news:OF**************@TK2MSFTNGP11.phx.gbl...

About the optional argument, I did find out that there is no such thing, but doesn''t something similar exist ???



Overloading - same function names, different arguments. E.g.

function testFunc()
{

{

function testFunc(string strTest)
{

}

function testFunc(string strTest, int intTest)
{

}


这篇关于C#中的可选参数???的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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