Why learn C#?
C# is Microsoft's flagship language, powering .NET web apps, Unity game development, desktop applications, and cloud services on Azure. Companies like Microsoft, Stack Overflow, and thousands of game studios use C#. Its modern features — LINQ, async/await, pattern matching — make it productive and enjoyable to write.
What you'll learn in this C# tutorial
This free, interactive C# course covers variables, data types, control flow, loops, functions, classes, inheritance, interfaces, LINQ, async/await, error handling, and .NET patterns — all by compiling and running real C# code in your browser.
36 topics · 255 hands-on lessons · all levels
C# tutorial topics
- 1Getting Started with C#Write your first C# program, understand the class structure, and get comfortable… · 8 lessons
- 2Variables and TypesLearn value types, reference types, constants, type conversion, and nullability … · 5 lessons
- 3VariablesDeclare variables with var and explicit types, use const and readonly, and under… · 8 lessons
- 4Data TypesIntegers, floats, booleans, chars, and type conversions in C#. · 8 lessons
- 5Print FormattingMaster Console output, string interpolation, composite formatting, and format sp… · 5 lessons
- 6StringsString creation, interpolation, formatting, and common string methods in C#. · 8 lessons
- 7Control Flowif/else, switch expressions, ternary operator, and short-circuit evaluation. · 8 lessons
- 8Loopsfor, while, do-while, foreach — all the ways to repeat code in C#. · 8 lessons
- 9Dictionaries and SetsDictionary<K,V>, HashSet<T>, iteration, and common collection patterns in C#. · 5 lessons
- 10MethodsDefine and call static methods, use parameters and return values, and understand… · 8 lessons
- 11ArraysSingle and multi-dimensional arrays, iterating, sorting, and Array class methods… · 8 lessons
- 12Functions and MethodsStatic methods, parameters, return types, overloads, optional/named args, and ex… · 5 lessons
- 13Lists and CollectionsList<T>, Dictionary<K,V>, HashSet<T> — C#'s generic collections. · 8 lessons
- 14Properties and Value SemanticsFields, auto-properties, computed properties, init-only setters, and value vs re… · 5 lessons
- 15Classes and ObjectsDefine classes, create objects, write constructors, and understand instance meth… · 8 lessons
- 16Structs and ClassesDefining classes, constructors, access modifiers, inheritance, and structs in C#… · 5 lessons
- 17PropertiesAuto-properties, get/set, computed properties, and init-only properties. · 8 lessons
- 18InheritanceBase classes, derived classes, virtual/override methods, abstract classes, and s… · 8 lessons
- 19Error HandlingExceptions, try/catch/finally, custom exceptions, and the Result pattern in C#. · 5 lessons
- 20InterfacesDefine contracts with interface, implement multiple interfaces, and use default … · 8 lessons
- 21EnumsDefine enumerated types, use Flags enums for bit fields, and parse enums from st… · 8 lessons
- 22Namespaces and ModulesNamespaces, using directives, file-scoped namespaces, access modifiers, and NuGe… · 5 lessons
- 23Async/Await and Concurrencyasync/await, Task, Task<T>, parallel execution, cancellation, and thread safety … · 5 lessons
- 24Exception Handlingtry/catch/finally, throwing exceptions, custom exceptions, and when to use excep… · 8 lessons
- 25GenericsGeneric classes, methods, constraints, and covariance/contravariance. · 8 lessons
- 26LINQ BasicsQuery collections with LINQ: Where, Select, OrderBy, GroupBy, First, Aggregate. · 8 lessons
- 27Async/AwaitWrite asynchronous code with async/await, Task, Task<T>, and understand the thre… · 8 lessons
- 28JSON EncodingSerialize and deserialize JSON with System.Text.Json, custom converters, and Jso… · 5 lessons
- 29Nullable TypesNullable value types, nullable reference types, null-safety operators, and best … · 8 lessons
- 30Pattern Matching and switchswitch expressions, type patterns, property patterns, positional patterns, and g… · 5 lessons
- 31Pattern Matchingswitch expressions, type patterns, property patterns, list patterns, and deconst… · 8 lessons
- 32Records and Value Objectsrecord types, value equality, non-destructive mutation with with, and positional… · 8 lessons
- 33Delegates and EventsDelegates as type-safe function pointers, Func and Action, events, and lambdas. · 8 lessons
- 34File I/ORead and write files with System.IO, work with paths, and stream large files. · 8 lessons
- 35TestingUnit testing with xUnit, assertions, test organisation, and mocking basics. · 8 lessons
- 36HTTP BasicsMake HTTP requests with HttpClient, parse JSON responses, and handle HTTP errors… · 8 lessons
Who is this C# course for?
Aspiring game developers (Unity), .NET web developers, Windows application developers, and developers building on the Microsoft stack.