luni, 25 august 2014

this C#

Refers to the current instance of the class
Example:

This is used to qualify the FirstName and LastName

class Person
{
            private string FirstName;
            private string LastName;
       public Person(string FirstName, string LastName)
       {
            this.FirstName = FirstName;
            this.LastName = LastName;
       }
}

Niciun comentariu:

Trimiteți un comentariu