Introduction to Object Oriented Programming
What is Object-Oriented Programming?
Object-Oriented Programming (OOP) is a methodology or paradigm for designing software through the utilization of classes and objects.
It streamlines both software development and maintenance.
OOP consists of:
● Class
A class is a blueprint or template for creating objects. It defines the attributes (data) and behaviors (methods) that objects of that class will have.
Think of a class as a cookie cutter, and objects as the cookies made from that cutter.
A class typically includes:
- Attributes
- Methods
- Constructor
- Destructor
● Object
An object is an instance of a class. It represents a specific realization of the attributes and behaviors defined by its class. Objects are created during run-time.
An object includes:
- State
- Behavior
- Identity (accessible via the
thiskeyword)