方法与财产的区别 [英] Difference Between Method and Property

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

问题描述

大家好,



基本问题出现在我的脑海里。所以我想和你讨论。



问题:方法和属性之间有什么区别。

Expect(方法和返回类型中的参数数量)



我们需要使用方法/属性的地方。

因为我们也可以通过使用方法和方法设置值也返回值。





我需要知道是否有任何性能问题或Standers用于编写方法/属性。

Hi Everybody,

The Basic Question arising in my mind. So I want to discussed with you.

Question : What is the Difference Between Method and Property.
Expect (Number of Prameter in Method and Return Type)

Where we need to Use Method/Property.
Because we can also set the value by using method and method also return the value.


I need to know that is there any Performance issue or Standers for writing the Method/Property.

推荐答案

您可以在找到一个很好的答案Stack Overflow (甚至在那里它被标记为'重复'问题):差异属性和方法之间[重复] [ ^ ]。
You may find a good answer at Stack Overflow (and even there it was marked as 'duplicate' question): Difference between Property and Method [duplicate][^].


方法执行一些影响应用程序的操作,并可能返回结果。属性是可以设置或返回的值,但不执行任何操作。为了准确,属性可能会在事件发生变化时向应用程序发出其值已更改的信号。
A Method does some action which affects the application, and may return a result. A Property is a value which can be set or returned, but does not do anything. To be accurate a property may raise an event when it is changed to signal the application that its value has changed.


您的方法将包含获取值并添加值所需的数据类型。你怎么添加它?简单。您使用添加的已定义属性或使用get {} set {}属性来定义用户添加的必需属性。一旦定义了该函数,该函数将拥有定义的属性,并且该属性将应用于您插入的值。

Your method will contain the datatypes needed for taking the values and adding it. How do you add it by the way?Simple. You use the defined property of addition or use get{} set{} property to define a user required property for addition. Once this is defined the function will possess the property defined and that property is applied to the values inserted by you.





参考



http://in.answers.yahoo.com/question/index?qid=20130129075946AAS0Ezx [ ^ ]


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

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