What is operator overloading?
- Defining custom behavior for operators (+, -, *, etc.) for a class.
class Point
public int X, Y;
public static Point operator +(Point a, Point b) => new Point {
X = a.X + b.X, Y = a.Y + b.Y };
class Point
public int X, Y;
public static Point operator +(Point a, Point b) => new Point {
X = a.X + b.X, Y = a.Y + b.Y };