Horje
c# field vs property Code Example
c# field vs property
public class MyClass
{
    // this is a field.  It is private to your class and stores the actual data.
    private string _myField;

    // this is a property. When accessed it uses the underlying field,
    // but only exposes the contract, which will not be affected by the underlying field
    public string MyProperty
    {
        get
        {
            return _myField;
        }
        set
        {
            _myField = value;
        }
    }

    // This is an AutoProperty (C# 3.0 and higher) - which is a shorthand syntax
    // used to generate a private field for you
    public int AnotherProperty { get; set; } 
}




Csharp

Related
how do you make a 2D object follow another 2D object in unity 2D Code Example how do you make a 2D object follow another 2D object in unity 2D Code Example
vb.net add row to datagridview programmatically Code Example vb.net add row to datagridview programmatically Code Example
c# debug writeline Code Example c# debug writeline Code Example
unity c# change animation Code Example unity c# change animation Code Example
string to camel case c# Code Example string to camel case c# Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10