Stage 1 · Lesson 4 of 7
Types, classes and interfaces
C# is statically typed: every variable has a type the compiler checks before the program runs. such as int, decimal, DateTime and structs are copied when you assign them. Reference types such as classes are shared: two variables can point at the same object.
Classes hold data and behaviour, and describe a contract, such as IEmailSender, that several classes can implement. Interfaces are everywhere in .NET because hands you an implementation of an interface. Learn properties, constructors, access modifiers and static members, plus decimal for money and DateTimeOffset or UTC for times. such as List<Order> keep collections type-safe.
Common trapusing double for amounts: 0.1 plus 0.2 is not exactly 0.3, and a bank will notice.
A question to check yourself, an AI practice session and 2 cheat sheet entries come with the full roadmap. Unlock
Resources for this stage
Start with· follow one of these
- GuideFreeLearn C#
Microsoft · Beginner
Free official C# path: syntax, types, classes, collections and exceptions with in-browser exercises
- GuideFree.NET documentation
Microsoft
The official .NET docs: start with the CLI overview, project files and the C# language tour
Practise
Keep handy
Also worth your time
The features that ship with .NET 10: extension members, the field keyword and null-conditional assignment
Object-oriented design worked through on real systems: classes, relationships and responsibilities
- Refactoring.Guru: Design PatternsGo deeper
Free: the classic design patterns explained with diagrams and C# examples