属性和方法之间的区别 [英] Difference between properties and methods

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

问题描述

你能用例子来解释属性和方法之间的区别??

Can you explain the difference between properties and methods with example??

推荐答案

将一个类与一个人进行比较,然后属性是像Age这样的人的属性,高度,重量等等和方法是人的能力和行为,如Walk(),Talk(),Run(),Sing()等。
Compare a class to a person, then properties are attributes of the person like Age, Height, Weight, etc. and methods are the abilities and actions of the person like Walk(), Talk(), Run(), Sing(), etc.


http://bit.ly/VPcsTn [ ^ ]


您好,



看看这里:

http://msdn.microsoft.com/en-us /library/vstudio/ms229054%28v=vs.100%29.aspx [ ^ ]

http://stackoverflow.com/qu estions / 2544707 /属性和方法之间的差异 [ ^ ]

http://stackoverflow.com/questions/1294152/method-vs-property-in-c-sharp-whats-the-difference [ ^ ]

http://stackoverflow.com/questions/601621/properties-vs-methods [ ^ ]
Hi,

Have a look here:
http://msdn.microsoft.com/en-us/library/vstudio/ms229054%28v=vs.100%29.aspx[^]
http://stackoverflow.com/questions/2544707/difference-between-property-and-method[^]
http://stackoverflow.com/questions/1294152/method-vs-property-in-c-sharp-whats-the-difference[^]
http://stackoverflow.com/questions/601621/properties-vs-methods[^]


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

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