C# Course

C# is a modern, versatile language for web back ends, cloud services, desktop and mobile apps, tools and games, running on the free, cross-platform .NET platform. This course teaches C# 14 on .NET 10 — the current long-term-support release — from your first single-file program through collections, object-oriented design, LINQ, async code and testing, finishing with a complete task-tracker application.

What you'll learn

The course has 63 lessons in eleven parts:

  • Getting Started — what C# and .NET are, installing the SDK, running single files with dotnet run, and projects.
  • Basics — syntax, variables, types, numbers and decimal, conversions, operators and user input.
  • Control Flow — if, switch statements and expressions, and loops.
  • Strings — string methods, interpolation and formatting, raw strings, StringBuilder and regular expressions.
  • Methods — parameters, ref/out, overloading, local functions and recursion.
  • Collections — arrays, lists, dictionaries, sets, queues and stacks, ranges and spans.
  • Object-Oriented Programming — classes, constructors, properties, encapsulation, inheritance, polymorphism, interfaces, structs, records, enums and equality.
  • Types & Patterns — nullable types, pattern matching, generics and C# 14 extension members.
  • Delegates & LINQ — lambdas, events, querying collections with LINQ, and iterators.
  • Errors, Files & Async — exceptions, using, files, JSON, dates, async/await and parallelism.
  • Projects & Modern C# — namespaces and solutions, NuGet and unit testing, what's new in C# 14, debugging, and a final project.

Every example in the course was compiled and run with the .NET 10 SDK (10.0.401), and the output shown is exactly what it printed. Examples build without warnings, except where a lesson shows a warning or error on purpose. The Try it yourself editors let you change any example and copy it to run on your own computer with dotnet run.

No previous programming experience is required. If you already know Java, C++ or TypeScript, you'll recognise a lot and can move quickly through the early parts.

Practice

  • Playground — a starter program to copy and experiment with.
  • Exercises — fill-in-the-blank tasks and programming challenges with solutions.
  • Quiz — test your understanding across the whole course.
  • Syllabus & Study Plan — learning outcomes and a week-by-week schedule.

Lessons

Getting Started

  1. Introduction to C#
  2. Setting Up .NET
  3. Your First Program
  4. Projects and the dotnet CLI

Basics

  1. Syntax and Comments
  2. Variables
  3. Data Types
  4. Numbers and Math
  5. Type Conversion
  6. Operators
  7. User Input

Control Flow

  1. if and else
  2. switch
  3. while Loops
  4. for and foreach Loops

Strings

  1. Strings
  2. String Methods
  3. String Formatting
  4. StringBuilder and Regular Expressions

Methods

  1. Methods
  2. Parameters and Arguments
  3. ref, out and in
  4. Overloading and Local Functions
  5. Recursion

Collections

  1. Arrays
  2. Multidimensional and Jagged Arrays
  3. Lists
  4. Dictionaries
  5. Sets, Queues and Stacks
  6. Indices, Ranges and Spans

Object-Oriented Programming

  1. Classes and Objects
  2. Constructors
  3. Properties
  4. Static Members
  5. Access Modifiers and Encapsulation
  6. Inheritance
  7. Polymorphism
  8. Abstract Classes
  9. Interfaces
  10. Structs and Records
  11. Enums
  12. Equality and Operator Overloading

Types & Patterns

  1. Nullable Types
  2. Pattern Matching
  3. Generics
  4. Extension Members

Delegates & LINQ

  1. Delegates and Lambdas
  2. Events
  3. LINQ Basics
  4. LINQ Grouping and Joins
  5. Iterators and yield

Errors, Files & Async

  1. Exceptions
  2. using and IDisposable
  3. Files and Directories
  4. Working with JSON
  5. Dates and Times
  6. async and await
  7. Parallelism and Thread Safety

Projects & Modern C#

  1. Namespaces and Multiple Files
  2. NuGet Packages and Unit Testing
  3. What's New in C# 14
  4. Debugging and Best Practices
  5. Project: A Task Tracker

Practice

  1. C# Playground
  2. C# Exercises
  3. C# Quiz
  4. Syllabus & Study Plan
Where to start: begin with Introduction and install the .NET SDK in lesson 2 so you can run every example yourself. Afterwards, build web applications with our ASP.NET course, or keep your projects under version control with Git.