Get & Set Properties in VB.NET

Hello Experts?

What are set & get properties in vb.net? What are the uses of it? and when do we use it?

(I want your genuine opinion )

Thanks!!!!
developer2012Asked:
Who is Participating?
 
BuggyCoderConnect With a Mentor Commented:

In VB.NET, properties are nothing but natural extension of data fields. They are usually known as 'smart fields' in VB.NET community. We know that data encapsulation and hiding are the two fundamental characteristics of any object oriented programming language. In VB.NET, data encapsulation is possible through either classes or structures. By using various access modifiers like private, public, protected, internal etc it is possible to control the accessibility of the class members.

Usually inside a class, we declare a data field as private and will provide a set of public SET and GET methods to access the data fields. This is a good programming practice, since the data fields are not directly accessible out side the class. We must use the set/get methods to access the data fields.  

To Read more go here:-
http://www.vbdotnetheaven.com/Uploadfile/rajeshvs/PropertiesInVbDotNet04192005060237AM/PropertiesInVbDotNet.aspx
0
 
himanshutConnect With a Mentor Commented:
Refer to this:
http://www.csharp-station.com/Tutorials/Lesson10.aspx
This should answer your above questions.
0
 
developer2012Author Commented:
Thanks that helped!!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.