0Pricing
C# Academy · Lesson

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

  1. Value vs reference; literals; var inference; const/readonly
  2. Operators & expressions: arithmetic, comparison, logical
  3. Suffixes in practice; casting vs conversion; C# 6 object creation
← Back to C# Academy