Operator Overloading

Learn how to customize the behavior of arithmetic and comparison operators for user-defined types to create more expressive and intuitive code.

C# provides various operators for performing arithmetic and comparison. Some examples are +, -, >, and <.

Using these operators with numeric types is intuitive: