Many of the articles I read on the Internet claim that when creating properties in vb.net they must use the get / set methods and a member variable of the private class.
Same:
Public Class Person
Private _name as string
public property Name as string
get
return _name
end get
set(byval value as string)
_name = value
end set
end property
end class
If there is no logic in the get / set property , why not write the same property:
Public class Person
Public Property Name as string
end class
Is this because the properties were only intended to be accessed from outside the class, and you would save the variable in the class?
source
share