Module 04 of 12

Object-Oriented Programming

Lessons

About This Module

C# is built around objects. Almost every real program you'll read or write, from a console app to a web API, is a set of classes that hold data, expose behaviour, and collaborate with each other. Learning to design those classes well is what separates code that merely works from code that stays easy to change.

This module starts with classes and objects: what they are, how they relate, and how to implement a class in C#. It then moves to the design decisions that follow, comparing inheritance and interfaces and when each one is the right choice, before looking at abstract classes, which sit between a full base class and an interface.

Watch the lessons in order, then continue on to Collections & Generics.

Lessons

4 videos
01

Intro to OOP: Classes and Objects

An introduction to the core ideas of object-oriented programming: classes as blueprints, objects as the things built from them, and how the two relate.

02

Implementing a Class in C#

Turns the ideas from the previous lesson into working C# code by writing a class and creating objects from it.

03

Inheritance vs Interfaces in C#: Object Oriented Programming

Tim Corey explains when to use inheritance and when to opt for interfaces, showing how an inheritance-based design runs into trouble and how interfaces give a cleaner result.

04

C# Abstract Classes - What They Are, How to Use Them, and Best Practices

Tim Corey describes an abstract class as a blend between a full base class and an interface, then builds a demo app to show how to use one and what to avoid.