Learn C#
Learn C# step by step: console output, data types and variables, numbers, strings, logic and conditionals, arrays, loops, lists, methods, and your first classes with encapsulation.
- Beginner level
- 11 modules
- 62 lessons
- 237 tasks and questions
Syllabus
01Hello, C#Meet C# and .NET, read the structure of a C# program, print to the console, and write comments.5 lessons
02Data Types and VariablesStore values in typed variables, choose between int, double, decimal, bool, char and string, let the compiler infer types with var, and convert safely between types.6 lessons
03Numbers and OperatorsCalculate with C#'s arithmetic operators, handle integer division and remainders, update variables in place, control evaluation order, and use the Math class.5 lessons
04StringsWork with text in C#: index into strings, build them with concatenation and interpolation, format numbers, search and transform text with string methods, compare strings correctly, and split, join and build strings efficiently.6 lessons
05Logic and ConditionalsCompare values to get booleans, combine conditions with logical operators, and make decisions with if, else if, else, switch statements, switch expressions and the conditional operator.7 lessons
06ArraysStore fixed-size collections of values in arrays: declare and initialize them, read and change elements by index, and use the Array class to sort, search, reverse and copy.5 lessons
07LoopsRepeat code with while, do-while, for and foreach loops, steer loops with break and continue, and use loops to total, search and transform arrays.6 lessons
08ListsUse List<T> for collections that grow and shrink: create lists, add, insert and remove items, search and sort them, work with ranges, and loop over them safely.5 lessons
09MethodsOrganize code into methods: define and call them, pass arguments (including optional and named ones), return values, report extra results with out parameters, overload methods, and write compact expression-bodied members and lambdas.7 lessons
10Classes and ObjectsDefine your own types with classes. Give them fields and methods, create objects with new, expose data through properties, and initialize objects with constructors.5 lessons
11EncapsulationProtect an object's data and rules. Control access with access modifiers, validate changes in properties, make data read-only with private setters, get-only properties and readonly fields, and share members with static.5 lessons