Home > Article > Backend Development > What is the overloading capability of operators in C#
The following is a list of operators that can be overloaded in C#, and the operators that cannot be overloaded.
Serial number | Operator and description |
---|---|
1 |
, -, !, ~, , -- These unary operators accept one operand and can be overloaded. |
2 |
, -, *, /, % These binary operators Accepts two operands and can be overloaded. |
3 |
==, !=, , = Comparison operators can be overloaded. |
4 |
&&, || Conditional logical operators cannot be directly overloaded . |
5 |
=, -=, *=, /=, %= Assignment operators cannot be overloaded. |
6 | =, ., ?:, - These operators cannot be overloaded. |
The above is the detailed content of What is the overloading capability of operators in C#. For more information, please follow other related articles on the PHP Chinese website!