C# language basics
↑Build confidence with variables, expressions and loops before adding object-oriented abstractions. Every example should be understandable in plain .NET without requiring Unity.
Lessons and practical examples
Section titled “Lessons and practical examples”-
Conditions, switch and ternary: Make decisions with if, else, else if, switch and conditional expressions.
-
Enums, files and exceptions: Named states, safe file I/O, try/catch/finally and failure handling.
-
Loops and iteration: while, do while, for, foreach, break and continue with practical examples.
-
Methods, parameters and overloading: Declare methods, return values, use optional and named arguments, overload safely.
-
Operators and expressions: Arithmetic, assignment, comparison, logic and Math methods.
-
Strings, characters and booleans: Concatenation, interpolation, indexing, escaping and true/false values.
-
Syntax, variables and constants: Start a C# program, name values, print output and avoid mutable magic numbers.
-
Data types and type conversion: Choose integers, floating-point types, decimals and safe conversions.
How to study this section
Section titled “How to study this section”Start with one concept, work through a small example, and verify your prediction. Follow linked topics when a prerequisite or related idea needs more explanation.
