Since variables declared inside a method are available only within that method, and variables declared private within a class are only available within a class. What is the purpose of the this key word? Why would I want to have the following:
private static class SomeClass : ISomeClass
{
private string variablename;
private void SomeMethod(string toConcat)
{
this.variablename = toConcat+toConcat;
return this.variablename;
}
}
When this will do the exact same thing:
private static class SomeClass : ISomeClass
{
private string variablename;
private void SomeMethod(string toConcat)
{
variablename = toConcat+toConcat;
return variablename;
}
}
to practice my typing skills?