I study c# from a little bit old book, but it is nice book, here the author use this keyword to modify or call the field of the class but actually even if I delete this keyword from the method it works perfect. when do I need this keyword actually?
Dog dog = new();
System.Console.WriteLine(dog.GetAge());
dog.MakeOlder();
System.Console.WriteLine(dog.GetAge());
class Dog{
int age = 2;
// Field Declaration
public int GetAge(){
return this.age;
}
public void MakeOlder(){
this.age++;
}
}