开发者

Difference between member and method

开发者 https://www.devze.com 2023-01-11 12:41 出处:网络
I am searching for a difference between member and method.....开发者_如何学Go Member is a generic term that encompasses the following: Constructors, Methods, Properties, Fields, and Events.

I am searching for a difference between member and method.....开发者_如何学Go


Member is a generic term that encompasses the following: Constructors, Methods, Properties, Fields, and Events.

A method is a function that is associated with an instance of a class or a static class.


A "class member" is basically anything that can be contained within a class object. A "method" is a particular type of member, described by MSDN as such:

Methods define the actions that a class can perform.

See C#'s documentation on class members for a good explanation.


A member is just about everything that you can declare inside a class, a method is one possible member type.

Thomas


I'm not sure what you meen but a member of a class could be an propertie, a method, a public variable, a static method, another class, ..


A method is something you call to perform an action and maybe return some data. The easiest way I'd say to identify a method is of course it has brackets at the end ...(..)

A member holds some sort of data, could be a value or reference type.

0

精彩评论

暂无评论...
验证码 换一张
取 消