C# and .NET Tutorials: From OOP to Web APIs
An object-oriented programming series in C# (classes, constructors, access modifiers, inheritance, interfaces) and an introduction to building APIs with ASP.NET Core, including the kind of questions that show up in university OOP exams.
8 posts
Getting Into Object-Oriented Programming
- Introduction to OOP: Why Procedural Programming Falls ShortThe journey from procedural to object-oriented programming: escaping spaghetti code and turning real problems into maintainable code.
- C# Class and Object: Blueprint vs ProductLearn the core OOP building blocks, Class and Object, through the cake mold analogy, with Property, Method and Instance examples.
- C# Constructor: The Hidden Hero of Object CreationWhat is a constructor and why do you need it? Default, parameterized and overloaded constructors explained with real examples.
- C# Access Modifiers: Lock the Doors or Leave Them Open?What are public, private, protected and internal? How Getter/Setter methods secure data, explained with a bank account example.
Inheritance and Abstraction
- C# Inheritance and Polymorphism: virtual, override and newC# inheritance and polymorphism guide: base, constructor chaining, virtual/override vs new, sealed, is/as and the classic "what does this print?" question.
- C# Interface vs Abstract Class: Differences and When to UseC# interface vs abstract class: what each can contain, multiple interfaces, a decision guide, a payment example and typical exam questions with answers.
