AnyCompiler

Free · No signup

C# Tutorial

Learn C# from the ground up. Every code example on every lesson is real and runnable — the output shown was captured from an actual execution on this site's own compiler, not typed by hand — and you can try each one yourself with one click.

  1. 1Introduction to C#
  2. 2Your First C# Program
  3. 3Variables and Types
  4. 4Operators and Control Flow
  5. 5Methods
  6. 6Arrays and Lists
  7. 7Strings
  8. 8Classes and Objects
  9. 9Properties
  10. 10Encapsulation
  11. 11Inheritance
  12. 12Interfaces
  13. 13Structs and Value Types
  14. 14Generics
  15. 15Collections and LINQ
  16. 16Delegates and Events
  17. 17Nullable Types and Null Safety
  18. 18Exceptions and Resource Cleanup

More lessons are added regularly. Want to practice outside the tutorial? Open the C# compiler. Prefer Java? Read the Java tutorial. Prefer C++? Read the C++ tutorial. Prefer C? Read the C tutorial. Prefer Rust? Read the Rust tutorial. Prefer Go? Read the Go tutorial. Prefer TypeScript? Read the TypeScript tutorial. Prefer JavaScript? Read the JavaScript tutorial. Prefer Python? Read the Python tutorial. Prefer Kotlin? Read the Kotlin tutorial. Prefer Swift? Read the Swift tutorial. Prefer Bash? Read the Bash tutorial. Prefer Perl? Read the Perl tutorial. Prefer Ruby? Read the Ruby tutorial. Prefer R? Read the R tutorial. Prefer PHP? Read the PHP tutorial. Prefer Hindi? Hindi mein padhein. Prefer Urdu? Roman Urdu mein parhein. ¿Prefieres español? Leer en español. Prefere português? Ler em português.