C# Tutotial : Common operators : Part 3
Common Operators
- Assignment operator : =
- Arithmatic operator : + , - , * , / , %
- Comparison operator : == , < , > , <= , >=
- Conditional Operator : &&, ||
- Ternary Operator : ?: e.g. var temp = (val == true) ? "Correct" : "Incorrect";
- Null coalescing Operator : ??
Null coalescing operator
- If the variable is null than you can assign some value to it.
- e.g. var a = b ?? 0;
- if b is null than value stored in a is 0;
No comments