Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42305

VS 2010 [RESOLVED] Quick question on Class properties

$
0
0
Hi guys. I have a newbie question: Is there any substancial difference when creating properties for a class this way:

vb.net Code:
  1. Public Class Invoice
  2.  
  3.     Public Property customerName As String
  4.  
  5. End Class

As opposed to this:

vb.net Code:
  1. Public Class Invoice
  2.  
  3.     Private _name As String
  4.  
  5.     Public Property customerName As String
  6.         Get
  7.             Return _name
  8.         End Get
  9.         Set(ByVal value As String)
  10.             _name = value
  11.         End Set
  12.     End Property
  13.  
  14. End Class

Thank you!

Viewing all articles
Browse latest Browse all 42305

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>