Understanding OOP Concepts: OOP, Class & Object
In this article, I’m going to talk about OPP, Class & Object. OOP provides a clear modular structure for programs. Let’s try to get the basic idea:
Table of Contents
What is OOP?
Object-oriented programming is a programming methodology constructed around objects. OOP is associated with concepts such as class, object, Inheritance, Encapsulation, Abstraction, Polymorphism etc.

Before going to understand class & object, let’s have a look at the following figure:

Understanding Class
Class is a blueprint or template that defines the data and behavior of a type. It is a collection of properties and methods.
According to Figure 2, Car is a class. In the Car class, we may define the car brand, model etc. These are called properties/states/attributes. We’ll learn more about properties in the next article.
Note: When a class is defined, no memory is allocated.
Understanding Object
An object can be considered as an instance of a Class. It is a bundle of some characteristics and behavior.
According to Figure 2, Audi is an object of the Car class.
Note: When an object is created, memory is allocated.
Example in Java
This is the Car class in Java:
public class Car {
// properties, methods, etc.
}
and this is the object of Car:
Car audi = new Car();
Example in PHP
Let’s write the Car class and Audi object in PHP:
// class
class Car {
// properties, methods, etc.
}
// object
$audi = new Car ();
I’ll explain the properties and methods in the next article in detail.
Comment
Preview may take a few seconds to load.
Markdown Basics
Below you will find some common used markdown syntax. For a deeper dive in Markdown check out this Cheat Sheet
Bold & Italic
Italics *asterisks*
Bold **double asterisks**
Code
Inline Code
`backtick`Code Block```
Three back ticks and then enter your code blocks here.
```
Headers
# This is a Heading 1
## This is a Heading 2
### This is a Heading 3
Quotes
> type a greater than sign and start typing your quote.
Links
You can add links by adding text inside of [] and the link inside of (), like so:
Lists
To add a numbered list you can simply start with a number and a ., like so:
1. The first item in my list
For an unordered list, you can add a dash -, like so:
- The start of my list
Images
You can add images by selecting the image icon, which will upload and add an image to the editor, or you can manually add the image by adding an exclamation !, followed by the alt text inside of [], and the image URL inside of (), like so:
Dividers
To add a divider you can add three dashes or three asterisks:
--- or ***

Comments (0)