Key takeaways
- C# is the language and .NET is the platform; the CLR runs the compiled IL code and the garbage collector cleans memory.
- Value types hold data directly, reference types hold an address;
int?is needed for a nullable value type. - The four OOP pillars, encapsulation, inheritance, polymorphism and abstraction, each get a short example such as a bank account or a shape class.
- An abstract class versus interface table shows when to use each.
- LINQ, generics, delegates and async/await are covered with short, runnable examples.
About these C# notes
This page offers Uncodemy's C# notes as a free PDF. C# is a modern, type-safe, object-oriented language from Microsoft that is used for web apps, desktop apps, mobile apps and games, and .NET is the platform that runs it. The notes explain each idea in simple words with real-life comparisons (the restaurant, the recipe and the chef for C#, .NET and the CLR), a short code example and tables for keywords, modifiers and collections.
Please note: these are original Uncodemy learning notes, not the official Microsoft documentation. C# and .NET add features with each release, so check Microsoft Learn for the latest syntax.
What's inside the C# notes
The PDF has 13 pages arranged in 13 numbered sections. Here is what each section covers.
1. Start with C# and .NET
C# versus .NET, the CLR, IL and JIT, a diagram of how a .cs file becomes machine code, a Hello World console app created with dotnet new console and dotnet run, and top-level statements.
2. Variables, data types and operators
A table of int, double, decimal, char, string and bool, var, const, nullable types with ??, string interpolation, implicit and explicit conversion, int.Parse and int.TryParse, value types versus reference types, and the operator groups.
3. Control flow and loops
if and else if, the switch expression, the for, while and foreach loops, and a table of break, continue and return.
4. Methods, arrays and strings
Expression-bodied methods, optional parameters, overloading, ref and out parameters, arrays with Array.Sort, common string methods, string immutability and StringBuilder.
5. Classes and objects
Class as a blueprint and objects as real things (with a diagram), fields, properties, methods, constructors and static members, a Student class with two constructors and an object initializer, and the access modifiers public, private, protected and internal.
6. Encapsulation and properties
A bank account class that hides its balance and checks deposits, and property styles: read and write, private set, init and calculated properties.
7. Inheritance
A Person class inherited by Employee and Student (with a diagram), calling the parent constructor with base, the keywords protected and sealed, single class inheritance, and the is-a versus has-a test.
8. Polymorphism and abstraction
Overloading versus overriding in a table, virtual and override with Shape, Circle and Rectangle classes, and an abstract Animal class with an abstract method.
9. Interfaces, enums and records
An IPayment interface with UPI and card payment classes, an abstract class versus interface table, and short examples of struct, enum and record with the with expression.
10. Collections, generics and LINQ
List<T>, Dictionary<K,V>, HashSet<T>, Queue<T> and Stack<T>, a generic Box class and a generic Max method, and LINQ methods such as Where, Select, Sum, OrderByDescending and Any.
11. Exceptions and file I/O
try, catch (specific first, general last), finally and throw, reading and writing text files with the File class and StreamReader, and the using statement for cleanup.
12. Delegates, lambda and async
Func, Action and Predicate, lambdas, a Button class with an event, and async and await with HttpClient and Task.WhenAll.
13. Projects and practice
Seven console projects (calculator, student record manager, bank account system, shape area calculator, library management, file-based to-do app and a weather or API reader), a common mistakes table and 10 practice questions.
How to use these notes to learn C#
C# is a compiled, strongly typed language, so the compiler will teach you a lot if you write the code yourself.
- Install the .NET SDK and create one console project with
dotnet new console; add each example to it and rundotnet run. - Read every compiler error; it tells you the line and usually the fix.
- For the OOP sections, draw the class diagram first, then write the code.
- After the LINQ section, rewrite one of your loops as a LINQ query.
A simple three-pass method works well. In the first pass, read one section and run its examples. In the second pass, close the notes and write a small class or method that uses that section, then compare with the notes. In the third pass, a day or two later, answer two practice questions aloud and build one console project from section 13.
Syntax to remember
int? maybe = null; int result = maybe ?? 0;for nullable values.int.TryParse("42", out int n)to convert text safely.public int Id { get; private set; }andpublic string City { get; init; }for property styles.public class Employee : Personand: base(name)to call the parent constructor.public virtual double Area()in the parent andpublic override double Area()in the child.nums.Where(n => n % 2 == 0)for a LINQ filter.using var sr = new StreamReader("a.txt");to close files automatically.
Common mistakes beginners make
- Comparing objects with
==and expecting field-by-field comparison; overrideEqualsor compare the fields. - Forgetting
newbefore using a class, which leaves the variable null. - Catching the general
Exceptioneverywhere instead of the specific exception first. - Joining strings with
+inside a loop instead of usingStringBuilder. - Opening files or connections without a
usingstatement.
Interview focus: C# topics asked most
C# and .NET developer interviews for freshers usually test OOP and language basics before frameworks such as ASP.NET Core.
- Value types versus reference types, and boxing and unboxing.
- The four OOP pillars with examples.
- Abstract class versus interface, overloading versus overriding.
refversusout, string versus StringBuilder.- Garbage collection and
using, LINQ and async/await.
Typical questions
- What is the difference between a value type and a reference type?
- Explain the four pillars of OOP with a small example.
- Abstract class or interface: when do you use which?
- What is the difference between overloading and overriding?
- What is the difference between ref and out?
- What is boxing and unboxing? Why is it slow?
- Explain garbage collection and the using statement.
- How do async and await avoid blocking the thread?
The notes list boxing and unboxing as a practice question but do not explain it in detail: boxing wraps a value type such as an int inside an object on the heap, and unboxing copies it back, which costs extra memory and time.
A 7-day plan for C#
- Day 1: Start with C# and .NET, variables, data types and operators.
- Day 2: Control flow and loops, methods, arrays and strings. Build the calculator console app.
- Day 3: Classes and objects, encapsulation and properties. Build the bank account system.
- Day 4: Inheritance, polymorphism and abstraction. Build the shape area calculator.
- Day 5: Interfaces, enums and records, collections, generics and LINQ. Build the student record manager with
List<T>and LINQ. - Day 6: Exceptions and file I/O, delegates, lambda and async. Build the file-based to-do app.
- Day 7: answer the 10 practice questions from memory and rewrite one older project with classes and LINQ.
Build one small console project every week after that. Rewriting old code with classes and LINQ is a fast way to improve.
Who these notes are for
- Beginners who want to learn C# as a first or second programming language.
- B.Tech, BCA and MCA students with a C# or .NET paper or lab.
- Learners moving towards ASP.NET Core and .NET full stack development.
- Freshers revising C# and OOP before .NET developer interviews.
If you want to build web applications with C#, see the .NET Full Stack course after these notes. For web front ends, the HTML CSS Notes PDF and JavaScript Notes PDF cover the browser side.
Download C# Notes PDF
C# Notes PDF: OOP, .NET Basics and Code Examples
The PDF carries the same content as this page in a clean, print-ready layout, so you can read it offline and keep it for revision.
13 pages · 159 KB · PDF · Updated 5 Nov 2026