SlideShare a Scribd company logo
Need of Object Oriented
Programming
Amar Jukuntla
Object Oriented Programming
Procedure Oriented Programming Object Oriented Programming
Why Do We Need Object‐Oriented Programming?
• Object Oriented Programming was developed because
limitations were discovered in earlier approaches to
programming.
• To appreciate what OOP does, we need to understand
what these limitations are and how they arose from
traditional programming languages.
Object5
Object4
Object3
Object2
Object1
POP Vs. OOP
Procedure Oriented Programming Object Oriented Programming
• In OOP, program is divided into parts called
objects.
• OOP has access specifiers named Public, Private,
Protected, etc.
• OOP provides Data Hiding so provides more
security.
• In OOP, overloading is possible in the form of
Function Overloading and Operator Overloading.
• In OOP, data can not move easily from function to
function, it can be kept public or private so we can
control the access of data.
• Example of OOP are : C++, JAVA, VB.NET,
C#.NET.
• In POP, program is divided into small parts called
functions.
• POP does not have any access specifier.
• POP does not have any proper way for hiding data
so it is less secure.
• In POP, Overloading is not possible.
• In POP, Most function uses Global data for sharing
that can be accessed freely from function to
function in the system.
• Example of POP are : C, VB, FORTRAN, Pascal.
Advantages of OOP
• Code Reuse and Recycling: Objects created for Object Oriented Programs can easily be
reused in other programs.
• Design Benefits: Large programs are very difficult to write. Object Oriented Programs
force designers to go through an extensive planning phase, which makes for better designs
with less flaws. In addition, once a program reaches a certain size, Object Oriented
Programs are actually easier to program than non-Object Oriented ones.
• Software Maintenance: Programs are not disposable. Legacy code must be dealt with on
a daily basis, either to be improved upon (for a new version of an exist piece of software)
or made to work with newer computers and software. An Object Oriented Program is much
easier to modify and maintain than a non-Object Oriented Program. So although a lot of
work is spent before the program is written, less work is needed to maintain it over time.
• Simplicity
Binding
Binding
• Binding means link between
procedure call and code to be
executed.
• When a method call is resolved
at compile time, it is known
as STATIC BINDING.
• While if method invocation is
resolved at runtime, it is known
as DYNAMIC BINDING OR LATE
BINDING.
Continue…
 Because of polymorphism, a reference variable of type Parent can hold an object of type
Child, which extends Parent. Now if you call a virtual method (not private, final or static) on
this object, then Compiler can not find actual method, because it could be the one, which is
defined in Parent class, or the one which Child has overridden. This call can only be resolved
at runtime, when actual object is available. That's why this is known as RUNTIME OR
DYNAMIC BINDING.
 On the hand, private, static and final methods are resolved at compile time, because compiler
knows that they can't be overridden and only possible methods are those, which are defined
inside a class, whose reference variable is used to call this method. This is known as STATIC
OR COMPILE TIME BINDING, all private, static and final methods are resolved using static
binding.
Continue…
This concept is also closely related to method overloading and method overriding. As
dynamic binding happens when method overriding is possibility and overloaded method
calls are resolved at compile time, because they are always defined in same class.
• Class
• Class is a Blueprint for an Object.
• Object
• Object is instance of class or it is
created from class.
Attribute Behavior
Name Walk
Weight Run
Height Talk
Age Speak
Gender Sleep
P
R
O
P
E
R
T
I
E
S
M
E
T
H
O
D
S
Message Passing
Exception
OOP Features
• Encapsulation
• Inheritance
• Polymorphism
• Abstraction
• Method overloading
• Method overriding
OOP Features
• Encapsulation
• Encapsulation is the mechanism binds code and data together, and keeps both safe
from outside interference and misuse.
• Encapsulation is protective cover that prevents the code and data from being accessed
by other code defined outside.
• The process of wrapping up of data (properties) and behavior (methods) of an object
into single unit. In plain English means to be enclosed in or as if in a capsule.
• Advantages
• The fields of a class can be made read-only or write-only.
• A class can have total control over what is stored in its fields.
• The user doesn’t know how the class stores data.
Continue…
Class encapsulation
{
public void method1()
{
int i=0; //variable
String Name=“Variable”;
//variable
}
public void method2()
{
int i=0; //variable
String Name=“Variable”;
//variable
}
}
Continue…
• Inheritance
• Inheritance is the method creating the new class based on already existing class.
• The new desired class is called subclass or child class. The existing class is called parent
class or super class or base class.
• Inheritance is the process by which one object acquires the properties of another object.
• Example;
iPhone
iPhone-3s
iPhone-4
iPhone-5
iPhone-5s
Continue…
• Polymorphism
• Ability to change form is known as Polymorphism.
• Polymorphism means “many forms”.
• Method overloading, method overriding, interfaces are the example of
Polymorphism.
• Example:
• Overloading
• The same method name (method overloading) or operator
symbol (operator overloading) can be used in different contents.
• In method overloading, multiple methods having same name can
appear in a class, but with different signature.
• Java does not allow operator overloading yet + is overloaded for
class string. The ‘+’ operator can be used for addition as well as
string concatenation.
• Example:
• Add a1=new Add();
• Add a2=new Add(1,2);
• Add a3=new Add(1,2,3);
Continue…
• Overriding
• Defining a method in subclass having the same name as a method in the
parent class is known as Overriding.
Continue…
• Abstraction
• Abstraction specifies necessary and sufficient descriptions rather than
implementation details.
• Abstraction is an essential element of Object Oriented Programming. Through
abstraction we can manage complexity.
• Abstraction means hiding the unnecessary data from users. Abstraction defines only
the essential characteristics of an object.
Flower
Arranger
Gardeners
Grower
Wholesaler
Summary of Object Oriented Programming Concepts
• Everything is an Object.
• Computation is performed by objects communicating with each other, requesting
that other objects perform actions.
• Each object has its own memory, which consist of other objects.
• Every object is an Instance of a class. A class simply represents a grouping of
similar objects, such as integers or lists.
• The class is the responsible for behaviour associated with an object. That is, all
objects that are instance of the same class can perform the same action.
• Classes are organized into a singly rooted tree structure, called the Inheritance
hierarchy.

More Related Content

What's hot

Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++
Vineeta Garg
 
Object Oriented Programming Using C++
Object Oriented Programming Using C++Object Oriented Programming Using C++
Object Oriented Programming Using C++
Muhammad Waqas
 
Java(Polymorphism)
Java(Polymorphism)Java(Polymorphism)
Java(Polymorphism)
harsh kothari
 
C++ OOPS Concept
C++ OOPS ConceptC++ OOPS Concept
C++ OOPS Concept
Boopathi K
 
Principles and advantages of oop ppt
Principles and advantages of oop pptPrinciples and advantages of oop ppt
Principles and advantages of oop ppt
daxesh chauhan
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
kamal kotecha
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-Systems
Venkata Sreeram
 
Introduction to oops concepts
Introduction to oops conceptsIntroduction to oops concepts
Introduction to oops concepts
Nilesh Dalvi
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessingankur bhalla
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
Sujith Kumar
 
OOPS Basics With Example
OOPS Basics With ExampleOOPS Basics With Example
OOPS Basics With Example
Thooyavan Venkatachalam
 
Oop java
Oop javaOop java
Oop java
Minal Maniar
 
Java package
Java packageJava package
Java package
CS_GDRCST
 
Er model ppt
Er model pptEr model ppt
Er model ppt
Pihu Goel
 
Polymorphism in c++(ppt)
Polymorphism in c++(ppt)Polymorphism in c++(ppt)
Polymorphism in c++(ppt)
Sanjit Shaw
 
Object-oriented concepts
Object-oriented conceptsObject-oriented concepts
Object-oriented concepts
BG Java EE Course
 
Data members and member functions
Data members and member functionsData members and member functions
Data members and member functions
Harsh Patel
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivity
Tanmoy Barman
 

What's hot (20)

Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++
 
Object Oriented Programming Using C++
Object Oriented Programming Using C++Object Oriented Programming Using C++
Object Oriented Programming Using C++
 
Java(Polymorphism)
Java(Polymorphism)Java(Polymorphism)
Java(Polymorphism)
 
C++ OOPS Concept
C++ OOPS ConceptC++ OOPS Concept
C++ OOPS Concept
 
Characteristics of oop
Characteristics of oopCharacteristics of oop
Characteristics of oop
 
Principles and advantages of oop ppt
Principles and advantages of oop pptPrinciples and advantages of oop ppt
Principles and advantages of oop ppt
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-Systems
 
Introduction to oops concepts
Introduction to oops conceptsIntroduction to oops concepts
Introduction to oops concepts
 
OOP java
OOP javaOOP java
OOP java
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessing
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
 
OOPS Basics With Example
OOPS Basics With ExampleOOPS Basics With Example
OOPS Basics With Example
 
Oop java
Oop javaOop java
Oop java
 
Java package
Java packageJava package
Java package
 
Er model ppt
Er model pptEr model ppt
Er model ppt
 
Polymorphism in c++(ppt)
Polymorphism in c++(ppt)Polymorphism in c++(ppt)
Polymorphism in c++(ppt)
 
Object-oriented concepts
Object-oriented conceptsObject-oriented concepts
Object-oriented concepts
 
Data members and member functions
Data members and member functionsData members and member functions
Data members and member functions
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivity
 

Similar to Need of object oriented programming

Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP concepts
Ahmed Farag
 
Principles of OOPs.pptx
Principles of OOPs.pptxPrinciples of OOPs.pptx
Principles of OOPs.pptx
LakshyaChauhan21
 
Java OOP s concepts and buzzwords
Java OOP s concepts and buzzwordsJava OOP s concepts and buzzwords
Java OOP s concepts and buzzwords
Raja Sekhar
 
Oops and c fundamentals
Oops and c fundamentals Oops and c fundamentals
Oops and c fundamentals
umesh patil
 
C++ first s lide
C++ first s lideC++ first s lide
C++ first s lide
Sudhriti Gupta
 
1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt
1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt
1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt
sagarjsicg
 
SKILLWISE - OOPS CONCEPT
SKILLWISE - OOPS CONCEPTSKILLWISE - OOPS CONCEPT
SKILLWISE - OOPS CONCEPT
Skillwise Group
 
Object oriented programming
Object oriented programmingObject oriented programming
Oop.pptx
Oop.pptxOop.pptx
Oop.pptx
KalGetachew2
 
Questpond - Top 10 Interview Questions and Answers on OOPS
Questpond - Top 10 Interview Questions and Answers on OOPSQuestpond - Top 10 Interview Questions and Answers on OOPS
Questpond - Top 10 Interview Questions and Answers on OOPS
gdrealspace
 
Oop ppt
Oop pptOop ppt
Oop ppt
Shani Manjara
 
oop.pptx
oop.pptxoop.pptx
oop.pptx
KabitaParajuli3
 
Programming language paradigms
Programming language paradigmsProgramming language paradigms
Programming language paradigms
Ashok Raj
 
U1 JAVA.pptx
U1 JAVA.pptxU1 JAVA.pptx
U1 JAVA.pptx
madan r
 
Object Oriented Programming (OOP) Introduction
Object Oriented Programming (OOP) IntroductionObject Oriented Programming (OOP) Introduction
Object Oriented Programming (OOP) Introduction
SamuelAnsong6
 
Unit 2.pptx
Unit 2.pptxUnit 2.pptx
Unit 2.pptx
SherinRappai
 
Unit 2.pptx
Unit 2.pptxUnit 2.pptx
Unit 2.pptx
SherinRappai1
 
1 unit (oops)
1 unit (oops)1 unit (oops)
1 unit (oops)Jay Patel
 
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrdgxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
wrushabhsirsat
 

Similar to Need of object oriented programming (20)

Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP concepts
 
Principles of OOPs.pptx
Principles of OOPs.pptxPrinciples of OOPs.pptx
Principles of OOPs.pptx
 
Java OOP s concepts and buzzwords
Java OOP s concepts and buzzwordsJava OOP s concepts and buzzwords
Java OOP s concepts and buzzwords
 
Oops and c fundamentals
Oops and c fundamentals Oops and c fundamentals
Oops and c fundamentals
 
C++ first s lide
C++ first s lideC++ first s lide
C++ first s lide
 
1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt
1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt
1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt
 
SKILLWISE - OOPS CONCEPT
SKILLWISE - OOPS CONCEPTSKILLWISE - OOPS CONCEPT
SKILLWISE - OOPS CONCEPT
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Oop.pptx
Oop.pptxOop.pptx
Oop.pptx
 
Questpond - Top 10 Interview Questions and Answers on OOPS
Questpond - Top 10 Interview Questions and Answers on OOPSQuestpond - Top 10 Interview Questions and Answers on OOPS
Questpond - Top 10 Interview Questions and Answers on OOPS
 
Basic concepts of oops
Basic concepts of oopsBasic concepts of oops
Basic concepts of oops
 
Oop ppt
Oop pptOop ppt
Oop ppt
 
oop.pptx
oop.pptxoop.pptx
oop.pptx
 
Programming language paradigms
Programming language paradigmsProgramming language paradigms
Programming language paradigms
 
U1 JAVA.pptx
U1 JAVA.pptxU1 JAVA.pptx
U1 JAVA.pptx
 
Object Oriented Programming (OOP) Introduction
Object Oriented Programming (OOP) IntroductionObject Oriented Programming (OOP) Introduction
Object Oriented Programming (OOP) Introduction
 
Unit 2.pptx
Unit 2.pptxUnit 2.pptx
Unit 2.pptx
 
Unit 2.pptx
Unit 2.pptxUnit 2.pptx
Unit 2.pptx
 
1 unit (oops)
1 unit (oops)1 unit (oops)
1 unit (oops)
 
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrdgxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
 

More from Amar Jukuntla

Singly linked list
Singly linked listSingly linked list
Singly linked list
Amar Jukuntla
 
Types of files
Types of filesTypes of files
Types of files
Amar Jukuntla
 
Hashing
HashingHashing
Hashing
Amar Jukuntla
 
Unit 2
Unit 2Unit 2
Problem Solving
Problem Solving Problem Solving
Problem Solving
Amar Jukuntla
 
Intelligent Agents
Intelligent Agents Intelligent Agents
Intelligent Agents
Amar Jukuntla
 
Introduction
IntroductionIntroduction
Introduction
Amar Jukuntla
 
Sorting
SortingSorting
Sorting
Amar Jukuntla
 
Sorting
SortingSorting
Sorting
Amar Jukuntla
 
Nature of open source
Nature of open sourceNature of open source
Nature of open source
Amar Jukuntla
 
Linux Directory System: Introduction
Linux Directory System: IntroductionLinux Directory System: Introduction
Linux Directory System: Introduction
Amar Jukuntla
 
Introduction to Data Structures
Introduction to Data StructuresIntroduction to Data Structures
Introduction to Data Structures
Amar Jukuntla
 
Learning
LearningLearning
Learning
Amar Jukuntla
 
First Order Logic resolution
First Order Logic resolutionFirst Order Logic resolution
First Order Logic resolution
Amar Jukuntla
 
First Order Logic
First Order LogicFirst Order Logic
First Order Logic
Amar Jukuntla
 
A*
A*A*
Agents1
Agents1Agents1
Agents1
Amar Jukuntla
 

More from Amar Jukuntla (19)

Singly linked list
Singly linked listSingly linked list
Singly linked list
 
Types of files
Types of filesTypes of files
Types of files
 
Hashing
HashingHashing
Hashing
 
Planning
Planning Planning
Planning
 
Unit 2
Unit 2Unit 2
Unit 2
 
Problem Solving
Problem Solving Problem Solving
Problem Solving
 
Intelligent Agents
Intelligent Agents Intelligent Agents
Intelligent Agents
 
Introduction
IntroductionIntroduction
Introduction
 
DFS
DFSDFS
DFS
 
Sorting
SortingSorting
Sorting
 
Sorting
SortingSorting
Sorting
 
Nature of open source
Nature of open sourceNature of open source
Nature of open source
 
Linux Directory System: Introduction
Linux Directory System: IntroductionLinux Directory System: Introduction
Linux Directory System: Introduction
 
Introduction to Data Structures
Introduction to Data StructuresIntroduction to Data Structures
Introduction to Data Structures
 
Learning
LearningLearning
Learning
 
First Order Logic resolution
First Order Logic resolutionFirst Order Logic resolution
First Order Logic resolution
 
First Order Logic
First Order LogicFirst Order Logic
First Order Logic
 
A*
A*A*
A*
 
Agents1
Agents1Agents1
Agents1
 

Recently uploaded

Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 

Recently uploaded (20)

Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 

Need of object oriented programming

  • 1. Need of Object Oriented Programming Amar Jukuntla
  • 3. Procedure Oriented Programming Object Oriented Programming
  • 4. Why Do We Need Object‐Oriented Programming? • Object Oriented Programming was developed because limitations were discovered in earlier approaches to programming. • To appreciate what OOP does, we need to understand what these limitations are and how they arose from traditional programming languages.
  • 6. POP Vs. OOP Procedure Oriented Programming Object Oriented Programming • In OOP, program is divided into parts called objects. • OOP has access specifiers named Public, Private, Protected, etc. • OOP provides Data Hiding so provides more security. • In OOP, overloading is possible in the form of Function Overloading and Operator Overloading. • In OOP, data can not move easily from function to function, it can be kept public or private so we can control the access of data. • Example of OOP are : C++, JAVA, VB.NET, C#.NET. • In POP, program is divided into small parts called functions. • POP does not have any access specifier. • POP does not have any proper way for hiding data so it is less secure. • In POP, Overloading is not possible. • In POP, Most function uses Global data for sharing that can be accessed freely from function to function in the system. • Example of POP are : C, VB, FORTRAN, Pascal.
  • 8. • Code Reuse and Recycling: Objects created for Object Oriented Programs can easily be reused in other programs. • Design Benefits: Large programs are very difficult to write. Object Oriented Programs force designers to go through an extensive planning phase, which makes for better designs with less flaws. In addition, once a program reaches a certain size, Object Oriented Programs are actually easier to program than non-Object Oriented ones. • Software Maintenance: Programs are not disposable. Legacy code must be dealt with on a daily basis, either to be improved upon (for a new version of an exist piece of software) or made to work with newer computers and software. An Object Oriented Program is much easier to modify and maintain than a non-Object Oriented Program. So although a lot of work is spent before the program is written, less work is needed to maintain it over time. • Simplicity
  • 9. Binding Binding • Binding means link between procedure call and code to be executed. • When a method call is resolved at compile time, it is known as STATIC BINDING. • While if method invocation is resolved at runtime, it is known as DYNAMIC BINDING OR LATE BINDING.
  • 10. Continue…  Because of polymorphism, a reference variable of type Parent can hold an object of type Child, which extends Parent. Now if you call a virtual method (not private, final or static) on this object, then Compiler can not find actual method, because it could be the one, which is defined in Parent class, or the one which Child has overridden. This call can only be resolved at runtime, when actual object is available. That's why this is known as RUNTIME OR DYNAMIC BINDING.  On the hand, private, static and final methods are resolved at compile time, because compiler knows that they can't be overridden and only possible methods are those, which are defined inside a class, whose reference variable is used to call this method. This is known as STATIC OR COMPILE TIME BINDING, all private, static and final methods are resolved using static binding.
  • 11. Continue… This concept is also closely related to method overloading and method overriding. As dynamic binding happens when method overriding is possibility and overloaded method calls are resolved at compile time, because they are always defined in same class.
  • 12. • Class • Class is a Blueprint for an Object. • Object • Object is instance of class or it is created from class. Attribute Behavior Name Walk Weight Run Height Talk Age Speak Gender Sleep P R O P E R T I E S M E T H O D S
  • 15. OOP Features • Encapsulation • Inheritance • Polymorphism • Abstraction • Method overloading • Method overriding
  • 16. OOP Features • Encapsulation • Encapsulation is the mechanism binds code and data together, and keeps both safe from outside interference and misuse. • Encapsulation is protective cover that prevents the code and data from being accessed by other code defined outside. • The process of wrapping up of data (properties) and behavior (methods) of an object into single unit. In plain English means to be enclosed in or as if in a capsule. • Advantages • The fields of a class can be made read-only or write-only. • A class can have total control over what is stored in its fields. • The user doesn’t know how the class stores data.
  • 17. Continue… Class encapsulation { public void method1() { int i=0; //variable String Name=“Variable”; //variable } public void method2() { int i=0; //variable String Name=“Variable”; //variable } }
  • 18. Continue… • Inheritance • Inheritance is the method creating the new class based on already existing class. • The new desired class is called subclass or child class. The existing class is called parent class or super class or base class. • Inheritance is the process by which one object acquires the properties of another object. • Example;
  • 20. Continue… • Polymorphism • Ability to change form is known as Polymorphism. • Polymorphism means “many forms”. • Method overloading, method overriding, interfaces are the example of Polymorphism. • Example:
  • 21. • Overloading • The same method name (method overloading) or operator symbol (operator overloading) can be used in different contents. • In method overloading, multiple methods having same name can appear in a class, but with different signature. • Java does not allow operator overloading yet + is overloaded for class string. The ‘+’ operator can be used for addition as well as string concatenation. • Example: • Add a1=new Add(); • Add a2=new Add(1,2); • Add a3=new Add(1,2,3);
  • 22. Continue… • Overriding • Defining a method in subclass having the same name as a method in the parent class is known as Overriding.
  • 23. Continue… • Abstraction • Abstraction specifies necessary and sufficient descriptions rather than implementation details. • Abstraction is an essential element of Object Oriented Programming. Through abstraction we can manage complexity. • Abstraction means hiding the unnecessary data from users. Abstraction defines only the essential characteristics of an object.
  • 25. Summary of Object Oriented Programming Concepts • Everything is an Object. • Computation is performed by objects communicating with each other, requesting that other objects perform actions. • Each object has its own memory, which consist of other objects. • Every object is an Instance of a class. A class simply represents a grouping of similar objects, such as integers or lists. • The class is the responsible for behaviour associated with an object. That is, all objects that are instance of the same class can perform the same action. • Classes are organized into a singly rooted tree structure, called the Inheritance hierarchy.