Zexor
Well-known member
- Joined
- Nov 28, 2008
- Messages
- 520
- Programming Experience
- 3-5
What is the purpose of Public property? why would i do this instead of just doing Public abc as string?
Because you may want to do data validation on it before assigning the value to the Private variable. Because you might want to raise an event when the value in the Private variable changes. Because you might later want to make it a ReadOnly property. Because....
Would you like me to continue?
VB.NET:
Dim abc As String
Public Property abcValue() As String
Get
Return abc
End Get
Set(ByVal value As String)
abc = value
End Set
End Property
Would you like me to continue?