The Ultimate C# Series: Part 2 Methods

In this video you creating a method overloading which looks like this:

public class Point
{
public int X;
public int Y;
public Point(int x, int y)
{
this.X = x;
this.Y = y;
}
public void Move(int x, int y)
{
this.X = x;
this.Y = y;
}
public void Move(Point newLocation)
{
this.X = newLocation.X;
this.Y = newLocation.Y;
}
}

and here is my question what is the Move(Point newLocation) how we supposed to understand what is that if you don’t even explained that in the video… :face_with_monocle: :rage:

I kinda get the idea that in method Move ( Point (it’s type of variable and newLocation is just a name) the same like it was in
Move(int x)
Move(Point newLocation)

but i think that spot worth to have a bit more explanation :face_with_diagonal_mouth:

I guess Point is a class that would call inside a method and newLocation is the point class object that would call all the properties of point class

Hi,

To be specific Point is a structure available in C# (see doc @MSDN).

But nothing prevents you to create your own thanks to namespaces. Indeed your screenshot displays such class.

I did not take that course so I cannot be sure, but I don’t think it is the important bit in that part of course but rather to explain what overloading is.

Basically it gives you an opportunity to update an instance coordinates (X,Y) from another instance of Point.

Should you need any further explanation, please ask.

Regards.