Search This Blog

Monday, March 25, 2013

this C#

C > Keywords > This

Refers to the current instance of the class.

Example

1.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;
            }