Solved

Get & Set Properties in VB.NET

Posted on 2012-03-26
3
568 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now