Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Mutator method
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Visual Basic .NET=== This example illustrates the VB.NET idea of properties, which are used in classes. Similar to C#, there is an explicit use of the <code>Get</code> and <code>Set</code> methods. <syntaxhighlight lang="vbnet"> Public Class Student Private _name As String Public Property Name() Get Return _name End Get Set(ByVal value) _name = value End Set End Property End Class </syntaxhighlight> In VB.NET 2010, Auto Implemented properties can be utilized to create a property without having to use the Get and Set syntax. Note that a hidden variable is created by the compiler, called <code>_name</code>, to correspond with the Property <code>name</code>. Using another variable within the class named <code>_name</code> would result in an error. Privileged access to the underlying variable is available from within the class. <syntaxhighlight lang="vbnet"> Public Class Student Public Property name As String End Class </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)