Sunday , November 28 2021

Advantages of Object Oriented Programming Language in Java

Advantages of Object Oriented Programming Language in Java : When you want to create a problem as an Object Oriented Programming Approach, then it is not to decide how to divide the problem into functions, rather it is to decide whether the problem is Objects How to divide into

Advantages of Object Oriented Programming Language in Java
Advantages of Object Oriented Programming Language in Java

A simple question may come to mind that what are these objects? The answer is equally simple. Whatever we can think of, everything in the world is the object. Nevertheless, for the purpose of explaining a bit, here we are giving some examples of Objects.

Physical Objects

A program related to Lift in which the base point of the program depends on Lift, in which Lift can be called an Object.
In a program related to an economy, all the countries of the world can be considered as Object. Because the basic point of this program will be different countries, whose economy will depend on the entire program.
There can be different types of vehicle objects in a program related to Traffic Flow, because the entire program will be developed by keeping the vehicles in the center.
In an air traffic related program, there will be Aircraft Objects from different countries.

Different components of a computer in a Computer User Environment

Objects like Window, Menu, Graphics Objects (Line, Rectangle, Circle) are Mouse, Keyboard, Toolbars, Command Buttons, Disk Drives, Printer etc.

Human Entities
Employees of a company
Various students of a school
Various customers
Salesmen etc. are objects because they are the basic units of a program.

In Data Storage Construct
Various Customized Arrays
Arrays
Stacks
Linked Lists
Binary Trees etc. are objects.

In Collection Of Data
Inventory
Personal File
Dictionary
Table of Longitude and Latitude

User Defined Data Types
In computer game
A picture
Chess or Checkers Pieces etc.
Animal signs
Objects can be different symbols
.

From these examples, we can understand that the basic object in any part of a program or in the whole program can be called an object. It is quite easy to divide any problem into an object. Because everything in the world can be considered as an object according to need. Each object has its own capabilities and each object can do some work. To understand this, let us see an example.

Large buildings have lifts for movement on different floors. This lift can be considered an object. Suppose there are four Passengers in an Lift on the fourth floor and Passengers press Button to go to the 8th, 10th and 15th floors, then the Lift has the capability that it can go down, it can go up, it Can open and close the doors, it can find out which floor the other Lifts are on and which floor it has to go next.

An object’s data in “C ++” takes into account the capabilities of the object and the Member Functions of the object take care of what the object can do with those data. This Lift Object can contain the following data-

Current_floor_number
Number_of_passengers
List_of_buttons_pussed
And Member Functions can be-

GoDown ()
GoUp ()
OpenDoors ()
CloseDoors ()
GetInfo ()
CalculateWhereToGo ()

Object-Oriented Programming has the properties of an object and the ability of the object at the same time, in the same way that the Object-Oriented Program consists of data and functions together as a unit, called Object.

Encapsulation is the process of combining functions that change object data and the state of those data into a unit or unit. The process obtained from the process of encapsulation is called the Template or Description Class.

Objects are the basic run time entities of an object oriented system. Objects take up space in memory and each object has a memory address.

When we execute an Object Oriented Program, then the various objects communicate with each other by passing message to each other i.e. calling their member functions.

For example, suppose “Customer” and “Account” are two objects. Now if the customer wants to know his bank balance, he passes a message to the Account Object and requests to get information about his bank balance. The Account Object completes the request of the Customer Object and provides it with information about Bank Balance.

In this way, Customer Object can get the information of its balance without knowing what data are in the Account Object. In order to know your balance, the Customer Object only has to take care that the Account Object will provide the information of the Account Balance on passing which message to the Account Object i.e. which Member Function of the Account Object is called. (Advantages of Object Oriented Programming)

Read More – Event Handling in Android – Android Developer Guide

About dmtechnolab

Check Also

Simplified Coding

Android Espresso Tutorial – Testing Fragment in Isolation – Android Coding by DMTechnolab

Welcome to another tutorial in the Android test series. And this post is called Android …

Leave a Reply

Your email address will not be published. Required fields are marked *