Introduction to Object Orientation and C# Classes

Difficulty: Intermediate
Duration: 1 minute and 5 seconds
Students: 761
Rating: 4.6/5

This lesson takes code from the Data Types and Variables lesson and refines it using object-oriented (OO) principles. We explore some of the main concepts of OO programming during this process, such as encapsulation, code reuse, and inheritance.

Along the way, we learn more about essential code structures such as conditional evaluation with if-then-else statements, functions for grouping code that performs a specific task, and for-loops for dynamically repeating an action. We will also look at how .NET and C# have object-oriented baked-in as a fundamental design principle underpinning the framework and language.

Learning Objectives

  • Understand the benefits of object orientation and what came before it
  • Learn about essential code structures and turn code into a class
  • Refine the class code and learn more object-oriented concepts
  • Learn about inheritance, a fundamental object-oriented concept
  • Understand how object-orientation is a foundation principle of C# and .NET

Intended Audience

This lesson is intended for those who already have an understanding of data types and variables in C# and now want to learn about object-oriented principles.

Prerequisites

To get the most out of this lesson, you should have an understanding of C# as well as basic data types: strings, numbers, and Booleans. In order to follow along with the demos, you should also have a working development environment, whether in Windows, Linux, or macOS.

Resources

The GitHub repository for this lesson can be found here.

 

Covered Topics