1
C# Keywords Quick Reference
C#
| Keyword | Meaning |
|---|---|
| var | Type inferred at compile time (still strongly typed) |
| dynamic | Type checked at run time |
| ref / out / in | Pass by reference; out must be assigned inside; in is read-only |
| static | Belongs to the class, not an object |
| sealed | Class cannot be inherited |
| partial | Class split across files |
| ?? / ?. | Null-coalescing / null-conditional operators |
| is / as | Type check / safe cast (null if it fails) |
string? name = null;
Console.WriteLine(name?.Length ?? 0); // 0
void Divide(int a, int b, out int q, out int r) { q = a / b; r = a % b; }
Divide(17, 5, out int q, out int r); // q = 3, r = 2