Value vs reference; literals; var inference; const/readonly
Learn how value types differ from reference types, how literals and numeric suffixes work, when to use var, and the roles of const and readonly.
Why types matter
Goal: Understand value vs reference types and how variables, literals, and constants behave in everyday code.
Value vs reference
Value type: copies data on assignment (e.g., int, bool, struct). Reference type: copies a reference (class, array, string).
- Value: safer local changes
- Reference: shared object identity
All lessons in this course
- Value vs reference; literals; var inference; const/readonly
- Operators & expressions: arithmetic, comparison, logical
- Suffixes in practice; casting vs conversion; C# 6 object creation