Introduction to Object-Oriented Programming in Java

Yogeshwar
2 min readFeb 20, 2021

Before going in deep into OOP, let us first understand some basic things regarding OOP.

What is an Object?

Object is nothing but a real-world entity. All living and non-living things are considered as objects, ex: Person, Animal, Vehicle, etc. are nothing but objects in the real world. Now the question is why we need this real-world object in our Program.

Why we need real-world objects in Programming?

We need real-world objects in programming because they are part of the business. We are creating software to automate the business. Let take the example of Banking Business, to automate the banking process we need real-world objects like customer, Account, Employee, etc. So we call them Object. Now let us another important component in java.

What is Object in Java?

Technically we can call an object an instance of a class. An instance is a single, unique memory allocation of a class that represents that object. The process of creating the object of a class is called instantiation.

Object’s Characteristics

Let us consider a Human as a real-world object,

Real-world objects contain three main Characteristics,

  1. State:- It is object properties, for the human object it is a name, height, weight, etc.
  2. Behaviour:-It is an operation of an object means using this object what operations we can do like for a human object it can perform some actions like sleep, walk, eat, run, climb, etc.
  3. Identity:-It is unique property using which that object is differentiated from another, for human properties like height, weight, face look.

Now we will understand about class.

What is a class in Java?

A class is a blueprint or template of an object that defines what goes to make up an object. We can say a class is a logical construct and an object has a physical reality. A class represents objects logically with that object’s properties and behaviors.

The below example will provide more clarity :

Here Bank is a real-world object with properties and behavior.
Here we are performing operations on the object.

In this article, we understood Object and Class, in the next article, we will look into Object-oriented programming i.e OOP. A most important concept in Java.

Keep in touch, Sharing is Caring!

Thank you…

--

--

Yogeshwar

Hi, I am Yogeshwar. I am a Software developer by Profession and I am here to share knowledge with you guys.