2. Features of OOP in C++
An overview of key object-oriented programming concepts in C++
Submitted to : Ms. Shalinee Pareek
Submitted by : Gulshan Kumar
(MUR2301513)
3. Introduction to OOP
OOP stands for Object-Oriented Programming
OOP models real-world entities as objects
Objects contain data (attributes) and functions (methods)
C++ fully supports OOP since C++11 standard
4. Classes and Objects
A class is user defined blueprint or prototype from
Objects are called instance of a class.
Class represents set of properties and method.
Objects can store state and exhibit behavior.
which objects are created.
5.
6.
7.
8. Encapsulation
Binding data and functions into a single unit is encapsulation
Class attributes can be declared private
Private attributes can only be accessed via public member
functions
Prevents direct modification of object state
9. Abstraction
Hiding internal implementation details
Showing only essential features to user
Achieved through abstract classes and interfaces
Provides reusability
10. Inheritance
Inheritance allows a derived class to acquire attributes and methods of a base
class
Provides reusability of code
Supported by public, protected and private inheritance
Can be single, multilevel or multiple inheritance
11. Polymorphism
Having many forms - one name, multiple implementations
achieved through function overloading and overriding
Compile-time polymorphism with function overloading
Runtime polymorphism with virtual functions
12. Summary
OOP makes code reusable and modular
Classes, objects, inheritance and polymorphism are key concepts
Abstractions like abstract classes hide details
C++ fully supports OOP since C++11 standard