0

I am currently trying to learn c# and am quite confused by this:

public Square(string n, float w, float h)
    {
        this.name = n;
        this.width = w;
        this.height = h;
    }

works the same as this:

public Square(string n, float w, float h)
    {
        name = n;
        width = w;
        height = h;
    }

Why is this? I thought that you always had to put this before changing the variables. Could someone explain this to me please?

jameshc
  • 41
  • 6

0 Answers0