Stupid question
I have been learning the C# language over the last month or two from the book Visual C# 2008 and was wondering what is the "this" keyword used for. I see it coming up over and over again in the book but it doesn't seem that they give a good definition of what it is used for.
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Satish KathiRank #8,369 · 223 reputationPosted Jul 11, 2008, 8:05 PM EDT
Refer this
http://msdn.microsoft.com/en-us/library/dk1507sz(VS.80).aspx
Bechir BejaouiRank #144 · 15.9K reputationPosted Jul 12, 2008, 6:25 AM EDT
example:
public class Person
{
/* The constructor the first method lunched after the object creation unsing new keyword */
public person(string FirstName, string LastName)
{
//The this here is used to refer the object it self, as you know
//the object person has a field called _FirstName and _LastName
this._FirstName;
this._LastName;
}
public string _FirstName;
public string _LastName;
}
in the other hand
Person me = new Person("Bejaoui","Bechir");
will define an object Person, in fact when me is created it invokes the Person(FirstName,LastName) then this or in this case me._FirstName<-FirstName
me._LastName<-LastName
Joe Doe3 reputationPosted Jul 12, 2008, 11:19 AM EDT