c#功能 [英] c# functions

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

问题描述

c#中的函数只适用于一个类的成员

myclass.Method / function


谢谢

Mark

are there functions in c# for just members of a class
myclass.Method/function

Thanks
Mark

推荐答案

2月7日上午11:39,标记 < analiz ... @ yahoo.comwrote:
On Feb 7, 11:39 am, "Mark" <analiz...@yahoo.comwrote:

c#中的函数只适用于一个类的成员

myclass.Method / function
are there functions in c# for just members of a class
myclass.Method/function



你指的是静态方法吗?


公共类MyClass

{

public static void SomeMethod()

{

//在这里做点什么

}

}

调用此方法:


MyClass.SomeMethod();

Are you referring to a static method?

public class MyClass
{
public static void SomeMethod()
{
//do something here
}
}
Call this method with:

MyClass.SomeMethod();


I认为这对我来说并不清楚。你能说得更好吗?


-

问候,

Robson Siqueira

企业架构师

" Mark" < a ******* @ yahoo.com写了留言

新闻:H9 **************** @ newssvr11.news.prodigy。 net ...
I think this is not clear for me. Would you please specify better?

--
Regards,
Robson Siqueira
Enterprise Architect
"Mark" <an*******@yahoo.comwrote in message
news:H9****************@newssvr11.news.prodigy.net ...

c#中的函数只适用于一个类的成员

myclass.Method / function


谢谢

马克
are there functions in c# for just members of a class
myclass.Method/function

Thanks
Mark



其他语言的例子......

可能有一个函数声明


函数int myfunc()

///做某事

返回

vb6

私人函数myfunc()

''//做某事

myfunc = true

结束功能

有类似上面的功能,不属于班级成员




是c#Class仅限驱动

公共myclass

{

public int myfunc()

{

//做某事

返回0

}

}

//主app

myclass = new myclass()。myfunc( )


谢谢

Mark



" Robson Siqueira" < ro **** @ robsonfelix.com写信息

新闻:uG ************** @ TK2MSFTNGP05.phx.gbl ...
Example in other languages.....
there could be a function declaration

Function int myfunc()
///do somthing
return
vb6
private function myfunc()
''// do somthing
myfunc=true
end function
is there functions like the above that do not belong as member in a class
Or

is c# Class Driven only
public myclass
{
public int myfunc()
{
// do somthing
return 0
}
}
// main app
myclass = new myclass().myfunc()

thanks
Mark


"Robson Siqueira" <ro****@robsonfelix.comwrote in message
news:uG**************@TK2MSFTNGP05.phx.gbl...

>我认为这对我来说并不清楚。你能说得更好吗?


-

问候,

Robson Siqueira

企业架构师

" Mark" < a ******* @ yahoo.com写了留言

新闻:H9 **************** @ newssvr11.news.prodigy。 net ...
>I think this is not clear for me. Would you please specify better?

--
Regards,
Robson Siqueira
Enterprise Architect
"Mark" <an*******@yahoo.comwrote in message
news:H9****************@newssvr11.news.prodigy.net ...

> c#中的函数只适用于一个类的成员
myclass.Method / function

谢谢
Mark
>are there functions in c# for just members of a class
myclass.Method/function

Thanks
Mark




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

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