public static void Main()
Console.WriteLine(Display(p));
Console.WriteLine(DisplayWithPositionalPatterns(p));
static string Display(object o)
case Point p when p.X == 0 && p.Y == 0:
return $"({p.X}, {p.Y})";
static string DisplayWithPositionalPatterns(object o) => o switch
Point(var x, var y) => $"({x}, {y})",
public Point(int x1, int y1) => (X, Y) = (x1, y1);
public void Deconstruct(out int x2, out int y2) => (x2, y2) = (X, Y);