this keyword
hi guys can any one tell me the use of this keyword in C# language i want to know what exactly the code ****string person(string fName, string lName) { this.fName=FirstName; this.lName=LastName; }**** means and i want to know all the uses of this keyword ................thanks in advance
Vijaya KadiyalaPosted Feb 27, 2009, 3:43 PM
Hi
The this keyword refers to the current instance of the class. Static member functions do not have a this pointer. The this keyword can be used to access members from within constructors, instance methods, and instance accessors.
The following are common uses of this:
{
this.name = name;
this.alias = alias;
}
CalcTax(this);
Check out the below link:
http://msdn.microsoft.com/en-us/library/dk1507sz%28VS.71%29.aspx
Thanks -- Vijaya Kadiyala