Solved

Get & Set Properties in VB.NET

Posted on 2012-03-26
3
589 Views
Last Modified: 2012-03-26
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!!!!
0
Comment
Question by:developer2012
3 Comments
 
LVL 10

Assisted Solution

by:himanshut
himanshut earned 250 total points
ID: 37769757
Refer to this:
http://www.csharp-station.com/Tutorials/Lesson10.aspx
This should answer your above questions.
0
 
LVL 20

Accepted Solution

by:
BuggyCoder earned 250 total points
ID: 37769780

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
 

Author Comment

by:developer2012
ID: 37769800
Thanks that helped!!!
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sending an input value from a view to a controller in MVC 3 27
Need syntax help building hyperlink 2 40
Easy filter aspnet 2 34
MYSQL responding very slow 3 48
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question