Basics for C# and .NETs
C# basics are the first language skills on the .NET path: value and reference types, variables, operators, conditionals and loops, then methods, classes, constructors, properties and access modifiers. Together they let you model data and behaviour as objects, and they underpin every later topic such as LINQ, async code and ASP.NET Core.
Stage: Language · Part of the C# and .NET roadmap · Last reviewed 19 November 2026
What to learn in Basics
- Declare variables and use int, string, bool, decimal and var correctly
- Write if, switch and foreach logic to control program flow
- Define a method with parameters, return values and default arguments
- Create a class with fields, properties and a constructor
- Explain the difference between a value type and a reference type
Basics interview questions
What is the difference between a struct and a class in C#?
A class is a reference type: variables hold a reference to an object on the heap. A struct is a value type: variables hold the data itself and assignment copies it. Structs suit small, immutable data, while classes suit shared, larger objects.
What does the var keyword do in C#?
Var asks the compiler to infer a local variable's type from the right-hand side at compile time. It is still strongly typed, not dynamic. It reduces repetition for obvious types but should be avoided when the type is not clear to readers.
Where Basics fits in the C# and .NET roadmap
Basics belongs to the Language stage (beginner level), which takes about 44 hours. C# fundamentals.
Other units in this stage
Back to the full C# and .NET roadmap