SlideShare a Scribd company logo
12
Concepts of OOP Languages…
Encapsulation: “Wraps Data and Method”
• The mechanism that binds together Code and the Data it
manipulates.
• Keeps both safe from outside interference and misuse.
• The wrapping up of data and methods into a single unit
called class, access is tightly controlled through a well
defined interfaces.
Most read
20
Advantages and Disadvantages
Advantages:...
Extensibility(Resilience – System can be allowed to evolve): adding new
features or responding to changing operating environments can be solved
by introducing a few new objects and modifying some existing ones.
Maintainability: objects can be maintained separately, making locating
and fixing problems easier.
Re-usability: objects can be reused in different programs.
Design Benefits: Large programs are very difficult to write. OOPs 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.
Most read
21
Advantages and Disadvantages…
Disadvantages:
• Size: Programs are much larger than other programs.
• Effort: Require a lot of work to create, coders spent more time
actually writing the program.
• Speed: Slower than other programs, partially because of their size
also demand more system resources.
• Not all programs can be modelled accurately by the objects model.
• One programmer's concept of what constitutes an abstract object
might not match the vision of another programmer.
However; many novice programmers do not like Object Oriented
Programming because of the great deal of work required to produce
minimal results.
Most read
Object Oriented Programming
Concepts
Prepared using following Resources:
 Herbert Schildt, “Java: The Complete Reference”, Tata McGrawHill Education
 E Balagurusamy, Programming with Java - A Tata McGraw Hill Education
 https://www.geeksforgeeks.org/java/
 https://www.javatpoint.com/java-tutorial
 https://www.tutorialspoint.com/java/index.htm
 https://www.w3schools.com/java/
By: DIVAKARA .N
• Background
• Programming Paradigms
• Concepts of OOPL
• Major and Minor elements
• Class, Object and relationships among objects
• Encapsulation
• Polymorphism
• Inheritance
• Message passing
• Difference between OOP and other conventional
programming
• Advantages, Disadvantages and Applications
Background:
• The process problem solving using a computer is
complicated process requiring careful planning,
logical precision, persistence and attention to
detail.
• A programmers primary task is to write software to
solve a problem.
• Many programming models have evolved to help
programmers in being more effective such as
Modular, Top-down, Bottom-up, Structured,
Object-Oriented programs etc.
Programming Paradigms:
• All computer programs consists of two elements:
Code and
Data
• A program can be conceptually organised around
its code or around its data.
• Major Programming Paradigms are:
Procedure Oriented
Object Oriented
Programming Paradigms: … POP
• The interdependent functions cannot be used in other
programs. As a result, even for a similar task across
programs, the entire function has to be recoded. This
made program development a more complex task.
• A change means rewriting huge portions of the code.
As a result of this, software maintenance costs are very
high.
• This approach failed to show the desired result in
terms bug free, easy-to-maintain and reusable
programs.
Programming Paradigms: … OOP
• An approach that provides a way of modularizing
programs by creating partitioned memory area for both
data and code that can be used as templates for
creating copies of such modules on demand.
• OOP is a programming methodology that helps
organizing complex programs through the use of the
three principles – Encapsulation, Polymorphism and
Inheritance.
• OOP enables you to consider a real-world entity as an
object.
• OOP combines user-defined data and instructions into
Programming Paradigms: … OOP…
It is a well suited paradigm for the following:
• Modelling the real world problem as close as
possible to the perspective of the user.
• Constructing reusable software components and
easily extendable libraries.
• Easily modifying and extending implementations
of components without having to recode everything
from scratch.
Concepts of OOP Languages
• Classes
• Objects
• Encapsulation
• Polymorphism
• Inheritance
• Dynamic Binding
• Message Communication
Concepts of OOP Languages…
Classes: “An user-defined data type/ADT”
• A blue print used to instantiate many objects.
• Defines set of data members (States/Attributes) and set of
methods (Behaviors).
• A template for an object / Collection of objects of similar
type.
• No memory is allocated when a class is created. Memory
is allocated only when an object is created, i.e., when an
instance of a class is created.
Concepts of OOP Languages…
Classes: …
• Eg: A Class of Cars under which Santro Xing, Alto and WaganR
represents individual Objects. In this context each Car Object will
have its own, Model, Year of Manufacture, Colour, Top Speed,
Engine Power etc., which form Properties of the Car class and the
associated actions i.e., object functions like Start, Move, Stop form
the Methods of Car Class.
Concepts of OOP Languages…
Objects: “Instances”
• The basic Building Blocks/Run-time Entities having two characteristics: State and
Behavior.
• An Object is a collection of data members and associated member functions also
known as methods.
• Each instance of an object can hold its own relevant data.
• Memory is allocated only when an object is created, i.e., when an instance of a
class is created.
• Eg: Employee emp1; emp1 = new Employee(); OR
Employee emp1 = new Employee();
Concepts of OOP Languages…
Encapsulation: “Wraps Data and Method”
• The mechanism that binds together Code and the Data it
manipulates.
• Keeps both safe from outside interference and misuse.
• The wrapping up of data and methods into a single unit
called class, access is tightly controlled through a well
defined interfaces.
Concepts of OOP Languages…
Polymorphism: “ability to take more than one form”
• A feature that allows one interface to be used for a general
class of actions.
• It allows an object to have different meanings, depending
on its context.
• “One Interface, Multiple Methods” to design a generic
interface to a group of related activities.
• Eg: Coffee day vending machine
Concepts of OOP Languages…
Polymorphism: …
Concepts of OOP Languages…
Inheritance: “The Idea of Reusability”
• The process by which one object acquires the properties of another
object OR the process of forming a new class from an existing class or
base class.
• Supports the concepts of hierarchical classifications.
• Inheritance helps in reducing the overall code size of the program.
Concepts of OOP Languages…
Dynamic Binding: “Associated with the concept of
Inheritance and Polymorphism”
• At run-time the code matching the object under current
reference will be called.
Concepts of OOP Languages…
Message Communication: “A request for execution of a method”
• Objects communicate with one another by sending and
receiving information.
• A message of an object is a request for execution of a
procedure/method that generates desired result.
• Eg: student1.examResult(4JC10CS901);
Difference between OOP and other conventional programming
Procedure Oriented Object Oriented
Emphasis is on procedure rather than
data, characterises a program as a
series of linear steps.
Emphasis is on data, data is hidden and
cannot be accessed by external functions.
Process-centric approach Data-centric approach
Programs are written around “What is
happening” – Code acting on data.
Programs are written around “Who is
being affected” – Data controlling access
to code.
Programs are divided into smaller
parts called functions/modules.
Programs are divided into objects, may
communicate with each other through
methods.
Function can call one from anther and
difficult to separate due to
interdependency between modules.
Objects are independent used for different
programs.
Follows Top-down approach in
program design.
Follows Bottom-up approach.
Eg: Basic, Pascal, COBOL, Fortran,
C, etc.
Eg: Smalltalk, C++, Objective C, Ada,
Objective Pascal, Java(Pure OOL), etc.
Advantages and Disadvantages
Advantages:
Simplicity: software objects model real world objects, so the
complexity is reduced and the program structure is very clear.
Modularity: each object forms a separate entity whose
internal workings are decoupled from other parts of the
system.
Modifiability: it is easy to make minor changes in the data
representation or the procedures in an OO program. Changes
inside a class do not affect any other part of a program, since
the only public interface that the external world has to a class
is through the use of methods.
Advantages and Disadvantages
Advantages:...
Extensibility(Resilience – System can be allowed to evolve): adding new
features or responding to changing operating environments can be solved
by introducing a few new objects and modifying some existing ones.
Maintainability: objects can be maintained separately, making locating
and fixing problems easier.
Re-usability: objects can be reused in different programs.
Design Benefits: Large programs are very difficult to write. OOPs 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.
Advantages and Disadvantages…
Disadvantages:
• Size: Programs are much larger than other programs.
• Effort: Require a lot of work to create, coders spent more time
actually writing the program.
• Speed: Slower than other programs, partially because of their size
also demand more system resources.
• Not all programs can be modelled accurately by the objects model.
• One programmer's concept of what constitutes an abstract object
might not match the vision of another programmer.
However; many novice programmers do not like Object Oriented
Programming because of the great deal of work required to produce
minimal results.
Applications:
• User-Interface Design (CUI/CLI, GUI...WIN), Games, CAD/CAM/CIM systems
• Real-Time System
• Simulation and Modeling
• Object-Oriented Database
• Artificial Intelligence and Expert Systems
• Neural Networks and Parallel Programs
• Decision Support and Office Automation System
A software that is easy to use hard to build. OOP changes the
way software engineers will Think, Analyse, Design and
Implement systems in the future.

More Related Content

Similar to 1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt (20)

Share Unit 1- Basic concept of object-oriented-programming.ppt
Share Unit 1- Basic concept of object-oriented-programming.pptShare Unit 1- Basic concept of object-oriented-programming.ppt
Share Unit 1- Basic concept of object-oriented-programming.ppt
hannahrroselin95
 
Object Oriented Programming using C++.pptx
Object Oriented Programming using C++.pptxObject Oriented Programming using C++.pptx
Object Oriented Programming using C++.pptx
parveen837153
 
Basic concept of OOP's
Basic concept of OOP'sBasic concept of OOP's
Basic concept of OOP's
Prof. Dr. K. Adisesha
 
Basic Java Concept - Practical Oriented Methodologies
Basic Java Concept - Practical Oriented MethodologiesBasic Java Concept - Practical Oriented Methodologies
Basic Java Concept - Practical Oriented Methodologies
SakthiVinayagam5
 
Unit 1 OOSE
Unit 1 OOSE Unit 1 OOSE
Unit 1 OOSE
ChhayaShelake
 
Birasa 1
Birasa 1Birasa 1
Birasa 1
Niyitegekabilly
 
JAVA PROGRAMMING
JAVA PROGRAMMING JAVA PROGRAMMING
JAVA PROGRAMMING
Niyitegekabilly
 
JAVA PROGRAMMINGD
JAVA PROGRAMMINGDJAVA PROGRAMMINGD
JAVA PROGRAMMINGD
Niyitegekabilly
 
Oop basic overview
Oop basic overviewOop basic overview
Oop basic overview
Deborah Akuoko
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
Sandeep Kumar Singh
 
130704798265658191
130704798265658191130704798265658191
130704798265658191
Tanzeel Ahmad
 
1unit-120324103142-phpapp02.pdf
1unit-120324103142-phpapp02.pdf1unit-120324103142-phpapp02.pdf
1unit-120324103142-phpapp02.pdf
SahajShrimal1
 
1 unit (oops)
1 unit (oops)1 unit (oops)
1 unit (oops)
Jay Patel
 
Procedural-vs-Object-Oriented-Programming (1).pdf
Procedural-vs-Object-Oriented-Programming (1).pdfProcedural-vs-Object-Oriented-Programming (1).pdf
Procedural-vs-Object-Oriented-Programming (1).pdf
AnujMalviya12
 
Chapter1
Chapter1Chapter1
Chapter1
jammiashok123
 
Introduction to oop with c++
Introduction to oop with c++Introduction to oop with c++
Introduction to oop with c++
Shruti Patel
 
yo.pptxoajsdisa odasjd asodjaojdoawjdoasjdow
yo.pptxoajsdisa odasjd asodjaojdoawjdoasjdowyo.pptxoajsdisa odasjd asodjaojdoawjdoasjdow
yo.pptxoajsdisa odasjd asodjaojdoawjdoasjdow
l226207
 
General OOP Concepts
General OOP ConceptsGeneral OOP Concepts
General OOP Concepts
Praveen M Jigajinni
 
Unit 1- Basic concept of object-oriented-programming.ppt
Unit 1- Basic concept of object-oriented-programming.pptUnit 1- Basic concept of object-oriented-programming.ppt
Unit 1- Basic concept of object-oriented-programming.ppt
hannahroseline2
 
What is OOP_ (Object Oriented Programming) (1).pptx
What is OOP_ (Object Oriented Programming) (1).pptxWhat is OOP_ (Object Oriented Programming) (1).pptx
What is OOP_ (Object Oriented Programming) (1).pptx
hreempandya
 
Share Unit 1- Basic concept of object-oriented-programming.ppt
Share Unit 1- Basic concept of object-oriented-programming.pptShare Unit 1- Basic concept of object-oriented-programming.ppt
Share Unit 1- Basic concept of object-oriented-programming.ppt
hannahrroselin95
 
Object Oriented Programming using C++.pptx
Object Oriented Programming using C++.pptxObject Oriented Programming using C++.pptx
Object Oriented Programming using C++.pptx
parveen837153
 
Basic Java Concept - Practical Oriented Methodologies
Basic Java Concept - Practical Oriented MethodologiesBasic Java Concept - Practical Oriented Methodologies
Basic Java Concept - Practical Oriented Methodologies
SakthiVinayagam5
 
1unit-120324103142-phpapp02.pdf
1unit-120324103142-phpapp02.pdf1unit-120324103142-phpapp02.pdf
1unit-120324103142-phpapp02.pdf
SahajShrimal1
 
1 unit (oops)
1 unit (oops)1 unit (oops)
1 unit (oops)
Jay Patel
 
Procedural-vs-Object-Oriented-Programming (1).pdf
Procedural-vs-Object-Oriented-Programming (1).pdfProcedural-vs-Object-Oriented-Programming (1).pdf
Procedural-vs-Object-Oriented-Programming (1).pdf
AnujMalviya12
 
Introduction to oop with c++
Introduction to oop with c++Introduction to oop with c++
Introduction to oop with c++
Shruti Patel
 
yo.pptxoajsdisa odasjd asodjaojdoawjdoasjdow
yo.pptxoajsdisa odasjd asodjaojdoawjdoasjdowyo.pptxoajsdisa odasjd asodjaojdoawjdoasjdow
yo.pptxoajsdisa odasjd asodjaojdoawjdoasjdow
l226207
 
Unit 1- Basic concept of object-oriented-programming.ppt
Unit 1- Basic concept of object-oriented-programming.pptUnit 1- Basic concept of object-oriented-programming.ppt
Unit 1- Basic concept of object-oriented-programming.ppt
hannahroseline2
 
What is OOP_ (Object Oriented Programming) (1).pptx
What is OOP_ (Object Oriented Programming) (1).pptxWhat is OOP_ (Object Oriented Programming) (1).pptx
What is OOP_ (Object Oriented Programming) (1).pptx
hreempandya
 

More from sagarjsicg (7)

IoT- Introduction-19th march.pptxhhvvvvvvcc
IoT- Introduction-19th march.pptxhhvvvvvvccIoT- Introduction-19th march.pptxhhvvvvvvcc
IoT- Introduction-19th march.pptxhhvvvvvvcc
sagarjsicg
 
6th_sem_web_unit1_part2.pptxhshshshshshshsh
6th_sem_web_unit1_part2.pptxhshshshshshshsh6th_sem_web_unit1_part2.pptxhshshshshshshsh
6th_sem_web_unit1_part2.pptxhshshshshshshsh
sagarjsicg
 
unit1-text.pptx regards rgat
unit1-text.pptx                regards rgatunit1-text.pptx                regards rgat
unit1-text.pptx regards rgat
sagarjsicg
 
6th_sem_web_unit1_bahagsgsgwgbapart1.pptx
6th_sem_web_unit1_bahagsgsgwgbapart1.pptx6th_sem_web_unit1_bahagsgsgwgbapart1.pptx
6th_sem_web_unit1_bahagsgsgwgbapart1.pptx
sagarjsicg
 
harshaAItogetaknoeledgeaboutthewhwhw.pptx
harshaAItogetaknoeledgeaboutthewhwhw.pptxharshaAItogetaknoeledgeaboutthewhwhw.pptx
harshaAItogetaknoeledgeaboutthewhwhw.pptx
sagarjsicg
 
chapter 11,12,15.pptx kya chal the hey bhai
chapter 11,12,15.pptx kya chal the hey bhaichapter 11,12,15.pptx kya chal the hey bhai
chapter 11,12,15.pptx kya chal the hey bhai
sagarjsicg
 
unit 1.pptx regasts sthatbabs shshsbsvsbsh
unit 1.pptx regasts sthatbabs shshsbsvsbshunit 1.pptx regasts sthatbabs shshsbsvsbsh
unit 1.pptx regasts sthatbabs shshsbsvsbsh
sagarjsicg
 
IoT- Introduction-19th march.pptxhhvvvvvvcc
IoT- Introduction-19th march.pptxhhvvvvvvccIoT- Introduction-19th march.pptxhhvvvvvvcc
IoT- Introduction-19th march.pptxhhvvvvvvcc
sagarjsicg
 
6th_sem_web_unit1_part2.pptxhshshshshshshsh
6th_sem_web_unit1_part2.pptxhshshshshshshsh6th_sem_web_unit1_part2.pptxhshshshshshshsh
6th_sem_web_unit1_part2.pptxhshshshshshshsh
sagarjsicg
 
unit1-text.pptx regards rgat
unit1-text.pptx                regards rgatunit1-text.pptx                regards rgat
unit1-text.pptx regards rgat
sagarjsicg
 
6th_sem_web_unit1_bahagsgsgwgbapart1.pptx
6th_sem_web_unit1_bahagsgsgwgbapart1.pptx6th_sem_web_unit1_bahagsgsgwgbapart1.pptx
6th_sem_web_unit1_bahagsgsgwgbapart1.pptx
sagarjsicg
 
harshaAItogetaknoeledgeaboutthewhwhw.pptx
harshaAItogetaknoeledgeaboutthewhwhw.pptxharshaAItogetaknoeledgeaboutthewhwhw.pptx
harshaAItogetaknoeledgeaboutthewhwhw.pptx
sagarjsicg
 
chapter 11,12,15.pptx kya chal the hey bhai
chapter 11,12,15.pptx kya chal the hey bhaichapter 11,12,15.pptx kya chal the hey bhai
chapter 11,12,15.pptx kya chal the hey bhai
sagarjsicg
 
unit 1.pptx regasts sthatbabs shshsbsvsbsh
unit 1.pptx regasts sthatbabs shshsbsvsbshunit 1.pptx regasts sthatbabs shshsbsvsbsh
unit 1.pptx regasts sthatbabs shshsbsvsbsh
sagarjsicg
 
Ad

Recently uploaded (20)

Empowering voices by Mariam-Sophie Karl: a Service Design project made in Swi...
Empowering voices by Mariam-Sophie	Karl: a Service Design project made in Swi...Empowering voices by Mariam-Sophie	Karl: a Service Design project made in Swi...
Empowering voices by Mariam-Sophie Karl: a Service Design project made in Swi...
sdnswitzerland
 
Blue and Green Corporate project phases chart graph.pptx
Blue and Green Corporate project phases chart graph.pptxBlue and Green Corporate project phases chart graph.pptx
Blue and Green Corporate project phases chart graph.pptx
AgnesNelgievanHuizen
 
ARTS IN DAILY LIVING-DRAWING TECHNIQUES_125650.pptx
ARTS IN DAILY LIVING-DRAWING TECHNIQUES_125650.pptxARTS IN DAILY LIVING-DRAWING TECHNIQUES_125650.pptx
ARTS IN DAILY LIVING-DRAWING TECHNIQUES_125650.pptx
christopherdada99
 
Styled_Soyabean_Milk_Presentation (1).pptx
Styled_Soyabean_Milk_Presentation (1).pptxStyled_Soyabean_Milk_Presentation (1).pptx
Styled_Soyabean_Milk_Presentation (1).pptx
ssuser1abcd4
 
presentatin format for submissionof.pptx
presentatin format for submissionof.pptxpresentatin format for submissionof.pptx
presentatin format for submissionof.pptx
Natashakarki1
 
Austin TX Connecting Neighborhoods Presentation
Austin TX Connecting Neighborhoods PresentationAustin TX Connecting Neighborhoods Presentation
Austin TX Connecting Neighborhoods Presentation
American Institute of Architects
 
Why_Do_Cats_Act_So_Weird.pptxbdhshshshshshh
Why_Do_Cats_Act_So_Weird.pptxbdhshshshshshhWhy_Do_Cats_Act_So_Weird.pptxbdhshshshshshh
Why_Do_Cats_Act_So_Weird.pptxbdhshshshshshh
zyx10283746
 
proposed bubble diagram caloocan city jail-Model.pdf
proposed bubble diagram caloocan city jail-Model.pdfproposed bubble diagram caloocan city jail-Model.pdf
proposed bubble diagram caloocan city jail-Model.pdf
GilBambilla
 
The_Secret_Life_of_Mossahahahahahah.pptx
The_Secret_Life_of_Mossahahahahahah.pptxThe_Secret_Life_of_Mossahahahahahah.pptx
The_Secret_Life_of_Mossahahahahahah.pptx
sambal5
 
Internet Download Manager (IDM) Crack Free Download 2025
Internet Download Manager (IDM) Crack Free Download 2025Internet Download Manager (IDM) Crack Free Download 2025
Internet Download Manager (IDM) Crack Free Download 2025
Designer
 
fire123xx2-blogspot-com-2025-06-fire-certificate-requirements-in-html.pdf
fire123xx2-blogspot-com-2025-06-fire-certificate-requirements-in-html.pdffire123xx2-blogspot-com-2025-06-fire-certificate-requirements-in-html.pdf
fire123xx2-blogspot-com-2025-06-fire-certificate-requirements-in-html.pdf
riyaarenainfosloutio
 
Chromatic house a case study presentation arch.pptx
Chromatic house a case study presentation arch.pptxChromatic house a case study presentation arch.pptx
Chromatic house a case study presentation arch.pptx
maheshwarigarvit2006
 
Poster Design Principles lesson for Kids
Poster Design Principles lesson for KidsPoster Design Principles lesson for Kids
Poster Design Principles lesson for Kids
emiliechingwork
 
Nueva presentación para diapositivas de power point.pdf
Nueva presentación para diapositivas de power point.pdfNueva presentación para diapositivas de power point.pdf
Nueva presentación para diapositivas de power point.pdf
SubaruKun1
 
iphone activation platform - a case study
iphone activation platform - a case studyiphone activation platform - a case study
iphone activation platform - a case study
Jem Rayfield
 
Computer Aided Design Introduction Lecture
Computer Aided Design Introduction LectureComputer Aided Design Introduction Lecture
Computer Aided Design Introduction Lecture
ShavinGopee2
 
(18+ CLIP!) Sophie Rain Spiderman Viral Video Clip Sophie Rain Original Video
(18+ CLIP!) Sophie Rain Spiderman Viral Video Clip Sophie Rain Original Video(18+ CLIP!) Sophie Rain Spiderman Viral Video Clip Sophie Rain Original Video
(18+ CLIP!) Sophie Rain Spiderman Viral Video Clip Sophie Rain Original Video
jamesfolkner123
 
UV_Unwrapping_Game_Dev_Alt.pptx ai presentation of animation
UV_Unwrapping_Game_Dev_Alt.pptx ai presentation of animationUV_Unwrapping_Game_Dev_Alt.pptx ai presentation of animation
UV_Unwrapping_Game_Dev_Alt.pptx ai presentation of animation
17218
 
Turquesa e Íconos de Salud Médico Tríptico Folleto_20250428_004458_0000.pdf
Turquesa e Íconos de Salud Médico Tríptico Folleto_20250428_004458_0000.pdfTurquesa e Íconos de Salud Médico Tríptico Folleto_20250428_004458_0000.pdf
Turquesa e Íconos de Salud Médico Tríptico Folleto_20250428_004458_0000.pdf
GloriaYolandaDoderoT
 
The_Sciencehggshshs_of_Everyday_Luck.pptx
The_Sciencehggshshs_of_Everyday_Luck.pptxThe_Sciencehggshshs_of_Everyday_Luck.pptx
The_Sciencehggshshs_of_Everyday_Luck.pptx
zyx10283746
 
Empowering voices by Mariam-Sophie Karl: a Service Design project made in Swi...
Empowering voices by Mariam-Sophie	Karl: a Service Design project made in Swi...Empowering voices by Mariam-Sophie	Karl: a Service Design project made in Swi...
Empowering voices by Mariam-Sophie Karl: a Service Design project made in Swi...
sdnswitzerland
 
Blue and Green Corporate project phases chart graph.pptx
Blue and Green Corporate project phases chart graph.pptxBlue and Green Corporate project phases chart graph.pptx
Blue and Green Corporate project phases chart graph.pptx
AgnesNelgievanHuizen
 
ARTS IN DAILY LIVING-DRAWING TECHNIQUES_125650.pptx
ARTS IN DAILY LIVING-DRAWING TECHNIQUES_125650.pptxARTS IN DAILY LIVING-DRAWING TECHNIQUES_125650.pptx
ARTS IN DAILY LIVING-DRAWING TECHNIQUES_125650.pptx
christopherdada99
 
Styled_Soyabean_Milk_Presentation (1).pptx
Styled_Soyabean_Milk_Presentation (1).pptxStyled_Soyabean_Milk_Presentation (1).pptx
Styled_Soyabean_Milk_Presentation (1).pptx
ssuser1abcd4
 
presentatin format for submissionof.pptx
presentatin format for submissionof.pptxpresentatin format for submissionof.pptx
presentatin format for submissionof.pptx
Natashakarki1
 
Why_Do_Cats_Act_So_Weird.pptxbdhshshshshshh
Why_Do_Cats_Act_So_Weird.pptxbdhshshshshshhWhy_Do_Cats_Act_So_Weird.pptxbdhshshshshshh
Why_Do_Cats_Act_So_Weird.pptxbdhshshshshshh
zyx10283746
 
proposed bubble diagram caloocan city jail-Model.pdf
proposed bubble diagram caloocan city jail-Model.pdfproposed bubble diagram caloocan city jail-Model.pdf
proposed bubble diagram caloocan city jail-Model.pdf
GilBambilla
 
The_Secret_Life_of_Mossahahahahahah.pptx
The_Secret_Life_of_Mossahahahahahah.pptxThe_Secret_Life_of_Mossahahahahahah.pptx
The_Secret_Life_of_Mossahahahahahah.pptx
sambal5
 
Internet Download Manager (IDM) Crack Free Download 2025
Internet Download Manager (IDM) Crack Free Download 2025Internet Download Manager (IDM) Crack Free Download 2025
Internet Download Manager (IDM) Crack Free Download 2025
Designer
 
fire123xx2-blogspot-com-2025-06-fire-certificate-requirements-in-html.pdf
fire123xx2-blogspot-com-2025-06-fire-certificate-requirements-in-html.pdffire123xx2-blogspot-com-2025-06-fire-certificate-requirements-in-html.pdf
fire123xx2-blogspot-com-2025-06-fire-certificate-requirements-in-html.pdf
riyaarenainfosloutio
 
Chromatic house a case study presentation arch.pptx
Chromatic house a case study presentation arch.pptxChromatic house a case study presentation arch.pptx
Chromatic house a case study presentation arch.pptx
maheshwarigarvit2006
 
Poster Design Principles lesson for Kids
Poster Design Principles lesson for KidsPoster Design Principles lesson for Kids
Poster Design Principles lesson for Kids
emiliechingwork
 
Nueva presentación para diapositivas de power point.pdf
Nueva presentación para diapositivas de power point.pdfNueva presentación para diapositivas de power point.pdf
Nueva presentación para diapositivas de power point.pdf
SubaruKun1
 
iphone activation platform - a case study
iphone activation platform - a case studyiphone activation platform - a case study
iphone activation platform - a case study
Jem Rayfield
 
Computer Aided Design Introduction Lecture
Computer Aided Design Introduction LectureComputer Aided Design Introduction Lecture
Computer Aided Design Introduction Lecture
ShavinGopee2
 
(18+ CLIP!) Sophie Rain Spiderman Viral Video Clip Sophie Rain Original Video
(18+ CLIP!) Sophie Rain Spiderman Viral Video Clip Sophie Rain Original Video(18+ CLIP!) Sophie Rain Spiderman Viral Video Clip Sophie Rain Original Video
(18+ CLIP!) Sophie Rain Spiderman Viral Video Clip Sophie Rain Original Video
jamesfolkner123
 
UV_Unwrapping_Game_Dev_Alt.pptx ai presentation of animation
UV_Unwrapping_Game_Dev_Alt.pptx ai presentation of animationUV_Unwrapping_Game_Dev_Alt.pptx ai presentation of animation
UV_Unwrapping_Game_Dev_Alt.pptx ai presentation of animation
17218
 
Turquesa e Íconos de Salud Médico Tríptico Folleto_20250428_004458_0000.pdf
Turquesa e Íconos de Salud Médico Tríptico Folleto_20250428_004458_0000.pdfTurquesa e Íconos de Salud Médico Tríptico Folleto_20250428_004458_0000.pdf
Turquesa e Íconos de Salud Médico Tríptico Folleto_20250428_004458_0000.pdf
GloriaYolandaDoderoT
 
The_Sciencehggshshs_of_Everyday_Luck.pptx
The_Sciencehggshshs_of_Everyday_Luck.pptxThe_Sciencehggshshs_of_Everyday_Luck.pptx
The_Sciencehggshshs_of_Everyday_Luck.pptx
zyx10283746
 
Ad

1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt

  • 1. Object Oriented Programming Concepts Prepared using following Resources:  Herbert Schildt, “Java: The Complete Reference”, Tata McGrawHill Education  E Balagurusamy, Programming with Java - A Tata McGraw Hill Education  https://www.geeksforgeeks.org/java/  https://www.javatpoint.com/java-tutorial  https://www.tutorialspoint.com/java/index.htm  https://www.w3schools.com/java/ By: DIVAKARA .N
  • 2. • Background • Programming Paradigms • Concepts of OOPL • Major and Minor elements • Class, Object and relationships among objects • Encapsulation • Polymorphism • Inheritance • Message passing • Difference between OOP and other conventional programming • Advantages, Disadvantages and Applications
  • 3. Background: • The process problem solving using a computer is complicated process requiring careful planning, logical precision, persistence and attention to detail. • A programmers primary task is to write software to solve a problem. • Many programming models have evolved to help programmers in being more effective such as Modular, Top-down, Bottom-up, Structured, Object-Oriented programs etc.
  • 4. Programming Paradigms: • All computer programs consists of two elements: Code and Data • A program can be conceptually organised around its code or around its data. • Major Programming Paradigms are: Procedure Oriented Object Oriented
  • 5. Programming Paradigms: … POP • The interdependent functions cannot be used in other programs. As a result, even for a similar task across programs, the entire function has to be recoded. This made program development a more complex task. • A change means rewriting huge portions of the code. As a result of this, software maintenance costs are very high. • This approach failed to show the desired result in terms bug free, easy-to-maintain and reusable programs.
  • 6. Programming Paradigms: … OOP • An approach that provides a way of modularizing programs by creating partitioned memory area for both data and code that can be used as templates for creating copies of such modules on demand. • OOP is a programming methodology that helps organizing complex programs through the use of the three principles – Encapsulation, Polymorphism and Inheritance. • OOP enables you to consider a real-world entity as an object. • OOP combines user-defined data and instructions into
  • 7. Programming Paradigms: … OOP… It is a well suited paradigm for the following: • Modelling the real world problem as close as possible to the perspective of the user. • Constructing reusable software components and easily extendable libraries. • Easily modifying and extending implementations of components without having to recode everything from scratch.
  • 8. Concepts of OOP Languages • Classes • Objects • Encapsulation • Polymorphism • Inheritance • Dynamic Binding • Message Communication
  • 9. Concepts of OOP Languages… Classes: “An user-defined data type/ADT” • A blue print used to instantiate many objects. • Defines set of data members (States/Attributes) and set of methods (Behaviors). • A template for an object / Collection of objects of similar type. • No memory is allocated when a class is created. Memory is allocated only when an object is created, i.e., when an instance of a class is created.
  • 10. Concepts of OOP Languages… Classes: … • Eg: A Class of Cars under which Santro Xing, Alto and WaganR represents individual Objects. In this context each Car Object will have its own, Model, Year of Manufacture, Colour, Top Speed, Engine Power etc., which form Properties of the Car class and the associated actions i.e., object functions like Start, Move, Stop form the Methods of Car Class.
  • 11. Concepts of OOP Languages… Objects: “Instances” • The basic Building Blocks/Run-time Entities having two characteristics: State and Behavior. • An Object is a collection of data members and associated member functions also known as methods. • Each instance of an object can hold its own relevant data. • Memory is allocated only when an object is created, i.e., when an instance of a class is created. • Eg: Employee emp1; emp1 = new Employee(); OR Employee emp1 = new Employee();
  • 12. Concepts of OOP Languages… Encapsulation: “Wraps Data and Method” • The mechanism that binds together Code and the Data it manipulates. • Keeps both safe from outside interference and misuse. • The wrapping up of data and methods into a single unit called class, access is tightly controlled through a well defined interfaces.
  • 13. Concepts of OOP Languages… Polymorphism: “ability to take more than one form” • A feature that allows one interface to be used for a general class of actions. • It allows an object to have different meanings, depending on its context. • “One Interface, Multiple Methods” to design a generic interface to a group of related activities. • Eg: Coffee day vending machine
  • 14. Concepts of OOP Languages… Polymorphism: …
  • 15. Concepts of OOP Languages… Inheritance: “The Idea of Reusability” • The process by which one object acquires the properties of another object OR the process of forming a new class from an existing class or base class. • Supports the concepts of hierarchical classifications. • Inheritance helps in reducing the overall code size of the program.
  • 16. Concepts of OOP Languages… Dynamic Binding: “Associated with the concept of Inheritance and Polymorphism” • At run-time the code matching the object under current reference will be called.
  • 17. Concepts of OOP Languages… Message Communication: “A request for execution of a method” • Objects communicate with one another by sending and receiving information. • A message of an object is a request for execution of a procedure/method that generates desired result. • Eg: student1.examResult(4JC10CS901);
  • 18. Difference between OOP and other conventional programming Procedure Oriented Object Oriented Emphasis is on procedure rather than data, characterises a program as a series of linear steps. Emphasis is on data, data is hidden and cannot be accessed by external functions. Process-centric approach Data-centric approach Programs are written around “What is happening” – Code acting on data. Programs are written around “Who is being affected” – Data controlling access to code. Programs are divided into smaller parts called functions/modules. Programs are divided into objects, may communicate with each other through methods. Function can call one from anther and difficult to separate due to interdependency between modules. Objects are independent used for different programs. Follows Top-down approach in program design. Follows Bottom-up approach. Eg: Basic, Pascal, COBOL, Fortran, C, etc. Eg: Smalltalk, C++, Objective C, Ada, Objective Pascal, Java(Pure OOL), etc.
  • 19. Advantages and Disadvantages Advantages: Simplicity: software objects model real world objects, so the complexity is reduced and the program structure is very clear. Modularity: each object forms a separate entity whose internal workings are decoupled from other parts of the system. Modifiability: it is easy to make minor changes in the data representation or the procedures in an OO program. Changes inside a class do not affect any other part of a program, since the only public interface that the external world has to a class is through the use of methods.
  • 20. Advantages and Disadvantages Advantages:... Extensibility(Resilience – System can be allowed to evolve): adding new features or responding to changing operating environments can be solved by introducing a few new objects and modifying some existing ones. Maintainability: objects can be maintained separately, making locating and fixing problems easier. Re-usability: objects can be reused in different programs. Design Benefits: Large programs are very difficult to write. OOPs 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.
  • 21. Advantages and Disadvantages… Disadvantages: • Size: Programs are much larger than other programs. • Effort: Require a lot of work to create, coders spent more time actually writing the program. • Speed: Slower than other programs, partially because of their size also demand more system resources. • Not all programs can be modelled accurately by the objects model. • One programmer's concept of what constitutes an abstract object might not match the vision of another programmer. However; many novice programmers do not like Object Oriented Programming because of the great deal of work required to produce minimal results.
  • 22. Applications: • User-Interface Design (CUI/CLI, GUI...WIN), Games, CAD/CAM/CIM systems • Real-Time System • Simulation and Modeling • Object-Oriented Database • Artificial Intelligence and Expert Systems • Neural Networks and Parallel Programs • Decision Support and Office Automation System A software that is easy to use hard to build. OOP changes the way software engineers will Think, Analyse, Design and Implement systems in the future.