Search⌘ K
AI Features

Is C++ an object-oriented programming language?

Understand object-oriented programming principles and how C++ incorporates these concepts. This lesson helps you identify whether C++ is fully or partially object-oriented and introduces key features such as classes, objects, inheritance, encapsulation, abstraction, and polymorphism within C++ programming.

Object-oriented programming (OOP) is one of the most popular programming paradigms. The C++ programming language is one of many languages that supports object-oriented programming, alongside Java, C#, Python, and JavaScript. Some developers consider C++ to be an object-oriented language, while others argue that it’s not. Today, we’ll discuss object-oriented programming to understand whether C++ is an object-oriented programming language.

What is object-oriented programming?

Object-oriented programming is a programming paradigm based on classes and objects and four OOP concepts of inheritance, encapsulation, abstraction, and polymorphism. OOP is modeled off the fact that the real world consists of objects, rather than the variables and functions we use in software development. In OOP, each object has properties and functions that it can perform. Objects that share properties and functions can be grouped into classes and subclasses, which serve as blueprints for the properties and functions that an object will inherit.

The foundational OOP concepts are:

  • Inheritance: The ability of a class to inherit data and behaviors from another class

    • The class that inherits features is the derived class, while the class it inherits features from is the base class

  • Encapsulation: The binding of data to the functions that can perform operations on them

    • Enables data hiding, another important OOP technique

  • Abstraction: The masking of internal functions to present only high-level methods to the ...