1. Home
  2. Training Library
  3. Programming
  4. Programming Courses
  5. Introduction to Classes and Objects in C++

Basics of OOP



The course is part of this learning path

Basics of OOP
1h 36m

Ever wondered how they maintain all the data and behaviors for the items in your inventory in a video game? Or maybe you've thought about how super-complex complex systems like banking systems, store management software, automotive digital diagnostic systems and tons of other applications were built? There's often a good chance that many of these applications use some form of Object-Oriented Programming. In this course, we look at Object-Oriented Programming, focusing on objects and classes.

Learning Objectives

  • Understand how classes are designed and constructed and how objects are created from them
  • Explore both the data members and member functions from which we build classes
  • Learn how to instantiate classes as objects
  • Learn how to use a rectangle class and a book class together and test them out

Intended Audience

  • Beginner coders, new to C++
  • Developers looking to upskill by adding C++ to their CV
  • College students and anyone studying C++


To get the most out of this course, you should have a basic understanding of the fundamentals of C++.


This lecture is going to focus mostly on some fundamental terms and theory, but theory helps us to become better practitioners, better developers in other words. So, don't skip this lecture. There are many different so-called programming paradigms which are simply classifications that we use to describe different programming languages. One of the earlier extremely popular programming paradigms was procedural programming, which focuses on procedures, which in our case specifically are functions that can perform tasks for us. We have used procedural programming a lot in this course, in fact. We have focused on solving problems by breaking them down into more manageable pieces that can be solved each by the functions that we write. The data that we work with is not very strongly associated or coupled with the functions that we use to operate on that data. A more modern popular programming paradigm that grew out of procedural programming is the object-oriented paradigm. Instead of focusing mostly on the procedures or functions, in our case, we focus on objects. An object represents some entity that has both behaviors and data. The behaviors are procedures or operations that the object exposes to perform tasks, the data and the behaviors live together in the object. This is a feature we call encapsulation. In fact, encapsulation is one of the three primary principles of object-oriented programming, also called OOP. You should memorize the names of all three even though we don't fully understand them right now. We will discuss each of them in more detail throughout the course. The three primary principles of Object-Oriented Programming or OOP are: encapsulation, inheritance, and polymorphism. You should learn them in that order as well. It helps to understand encapsulation before inheritance. And polymorphism doesn't make much sense without inheritance. So, understanding inheritance is particularly important. Before we move on, since we haven't learned the related syntax yet, our challenge for this lecture is based on what you learned specifically just now. So, I'm going to pause for a few seconds after I ask you a couple questions. First question is what does OOP stand for? And the second question is, what are the three primary principles of OOP? Did you get the solutions? OOP stands for Object-Oriented Programming. And again, the three primary principles with the order mattering, the three are: encapsulation, inheritance, and polymorphism. The remainder of this section aims to help us understand the fundamentals of classes and objects with a specific focus on encapsulation. We will cover inheritance and polymorphism in a later section in much more detail. Let's get going with encapsulation up next, I'll see you there.


About the Author
Learning Paths

John has a Ph.D. in Computer Science and is a professional software engineer and consultant, as well as a computer science university professor and department chair.

Covered Topics