Skip to content
Learn Netverks

Lesson

Step 1/36 3% through track

intro

Introduction to C#

Last reviewed May 28, 2026 Content v20260528
Track mode
server_compiled
Means
Compiled runner
Reading
~3 min
Level
beginner

This lesson

An orientation to the C# track—how the compiled playground works, core vocabulary, and what you will practice next.

You need a clear map of the C# track so the CLR, types, LINQ, and async/await do not feel like magic.

You will apply Introduction to C# in contexts like: .NET services, Unity games, and Windows-centric tooling.

Write C# with Console.WriteLine (top-level or Program), click Run on server—the dev runner uses dotnet build/run on a temp net8 project (requires .NET SDK; LEARNING_RUNNER_ENABLED=true). Also read the interview prep blocks.

After JavaScript or Java fundamentals—C# is approachable with prior OOP; then continue to the ASP.NET track for web.

How this C# track works

  • dotnet in the playground — write top-level statements or a Program class with Main; the dev runner compiles with a temporary .NET 8 console project and runs your code. Use Console.WriteLine for output.
  • Language + CLR focus — this track teaches C# syntax, OOP, LINQ, async, and .NET tooling. Web MVC, EF Core, and APIs live in the ASP.NET track after you finish here.
  • Prerequisites — finish JavaScript (variables, functions) and Java (classes, interfaces). C++ or Python help compare memory and typing models.

Multi-project solutions, NuGet restore, and Unity Editor workflows run locally—lessons keep runnable snippets to Console.WriteLine where the sandbox requires it.

Install on your device (macOS, Linux, Windows)

Install .NET 8 SDK for C# and ASP.NET Core on your machine.

macOS

  1. brew install --cask dotnet-sdk or script from dotnet.microsoft.com.

Linux

  1. Follow Microsoft docs for your distro: Install .NET on Linux (apt/dnf packages dotnet-sdk-8.0).

Windows

  1. winget install Microsoft.DotNet.SDK.8

Verify: dotnet --version shows 8.x.

Run code on this site (Backend & language playgrounds)

  1. Clone or open this project locally; copy .env.example to .env.
  2. Ensure LEARNING_RUNNER_ENABLED=true and LEARNING_RUNNER_URL=http://127.0.0.1:9999/v1/execute.
  3. Terminal 1: php artisan serve (or composer run dev for Laravel + Vite + runner together).
  4. Terminal 2: npm run runner — keep it running while you click Run on server.

Console app: dotnet new console -n Hello && cd Hello && dotnet run

C# is a modern, statically typed language for the .NET platform. It combines object-oriented design, functional features (LINQ, pattern matching), and async programming with tooling used in enterprise services, Unity games, and cloud workloads.

How this track differs from JavaScript and Java

After the JavaScript track, you know functions and dynamic typing in the browser. After Java, you know classes, interfaces, and JVM bytecode. C# feels familiar—properties, generics, exceptions—but targets the CLR with dotnet tooling and C#-specific features like LINQ and nullable reference types.

Unlike C++, C# is managed with garbage collection by default. Unlike PHP scripting, you compile before run. Web MVC, Razor, and EF Core live in the ASP.NET track after this language foundation.

What you will learn

  • Syntax: types, control flow, methods, namespaces, and top-level statements
  • OOP: classes, properties, inheritance, interfaces, records, and structs
  • Collections and LINQ: lists, dictionaries, queries, and generics
  • Modern C#: nullable references, pattern matching, async/await, exceptions, file I/O
  • .NET tooling: CLI, project structure, NuGet, debugging, testing, Unity teaser

Playground setup

This topic uses server_compiled: the runner creates a temporary .NET 8 console project, compiles your snippet, and executes it. Use Console.WriteLine for output—top-level statements are supported without writing a Main method.

Important interview questions and answers

  1. Q: What runtime executes C#?
    A: The Common Language Runtime (CLR) loads assemblies, JIT-compiles IL, and manages memory with a tracing garbage collector.
  2. Q: Why learn C# after Java?
    A: Syntax and OOP transfer directly—you then learn CLR, LINQ, and the path to ASP.NET or Unity.

Self-check

  1. In one sentence, what is the CLR?
  2. Where do MVC and EF Core belong in this curriculum?

Tip: Finish JavaScript and Java first—C# builds on familiar OOP with CLR-specific features like LINQ and nullable references.

Interview prep

What is C# in one sentence?

A statically typed, managed language for the .NET platform combining OOP, LINQ, async/await, and modern pattern matching with cross-platform tooling.

Why learn C# after Java?

Java teaches classes and interfaces on the JVM; C# maps those concepts to the CLR with properties, LINQ, and C#-specific features—essential for .NET and Unity careers.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs on the configured server runner (dev: npm run runner with LEARNING_RUNNER_ENABLED=true). Output appears below the editor.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • Why C# after Java?
  • First .NET project idea?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump