geter和setter属性C# [英] The geter and setter property C#

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

问题描述

大家好!

我是C#初学者。我想清楚地了解get set property C#。它是如何与封装相关的。给我一个很好的参考或例子。谢谢大家



我的尝试:



[只是重复上述内容]

Hi Everybody!
I m C# beginner. I wanna to clearly understand get set property C#. How it is related to encapsulation . Address me good reference or example. Thanks all of you

What I have tried:

[just a repetition of the above content]

推荐答案

我发现DotNetPearls.com是学习.Net细节的绝佳资源。例如,请参阅 C#属性示例 [ ^ ]
I find that DotNetPearls.com is a great resource for learning specifics of .Net. For example, see C# Property Examples[^]


查看封装属性 [ ^ ]。


以下两个参考资料对我有很大帮助:



深入讨论:为什么属性重要 [ ^ ]



TP://stackoverflow.com/questions/295104/what-is-the-difference-between-a-field-和 - a - 属性-IN- c [ ^ ]



谢谢。
Following two references which helped me a lot:

C# in Depth: Why Properties Matter[^]
and
tp://stackoverflow.com/questions/295104/what-is-the-difference-between-a-field-and-a-property-in-c[^]

Thanks.


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

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