SlideShare a Scribd company logo
2
Most read
4
Most read
12
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)

PPT
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
akashsachu221
 
PPTX
OOPsConceptspythonenineeringcomputerscienceand engineering.pptx
PraharikaCh
 
PPTX
Lesson 1 - Object Oriented Programming CPP103.pptx
LuiFlor
 
PDF
Oop basic overview
Deborah Akuoko
 
PPTX
CPP-Unit 1.pptx
YashKoli22
 
PPTX
Object Oriented Programming Part 2 of Unit 1
VigneshkumarPonnusam1
 
PPTX
Unit 2.pptx
SherinRappai
 
PPTX
Unit 2.pptx
SherinRappai1
 
PDF
itft-Fundamentals of object–oriented programming in java
Atul Sehdev
 
PDF
OOPS_Unit_1
Shipra Swati
 
PDF
Understanding the Basics of Object-Oriented Programming for Beginners
Emma Jacob
 
PPTX
java introduction features and propertie
SanaMateen7
 
PPTX
Object Oriented programming - Introduction
Madishetty Prathibha
 
PPTX
Object oriented programming
baabtra.com - No. 1 supplier of quality freshers
 
PPTX
C++ in object oriented programming
Saket Khopkar
 
PPT
Basic concept of OOP's
Prof. Dr. K. Adisesha
 
PPTX
1 unit (oops)
Jay Patel
 
PPTX
object oriented programming(oops)
HANISHTHARWANI21BCE1
 
PPTX
Need of object oriented programming
Amar Jukuntla
 
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
akashsachu221
 
OOPsConceptspythonenineeringcomputerscienceand engineering.pptx
PraharikaCh
 
Lesson 1 - Object Oriented Programming CPP103.pptx
LuiFlor
 
Oop basic overview
Deborah Akuoko
 
CPP-Unit 1.pptx
YashKoli22
 
Object Oriented Programming Part 2 of Unit 1
VigneshkumarPonnusam1
 
Unit 2.pptx
SherinRappai
 
Unit 2.pptx
SherinRappai1
 
itft-Fundamentals of object–oriented programming in java
Atul Sehdev
 
OOPS_Unit_1
Shipra Swati
 
Understanding the Basics of Object-Oriented Programming for Beginners
Emma Jacob
 
java introduction features and propertie
SanaMateen7
 
Object Oriented programming - Introduction
Madishetty Prathibha
 
C++ in object oriented programming
Saket Khopkar
 
Basic concept of OOP's
Prof. Dr. K. Adisesha
 
1 unit (oops)
Jay Patel
 
object oriented programming(oops)
HANISHTHARWANI21BCE1
 
Need of object oriented programming
Amar Jukuntla
 

More from sagarjsicg (7)

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

Recently uploaded (20)

PPTX
My_Engineering_Journey_Rahul_Rajbanshi.pptx
bikbikash24
 
PDF
PHILGOV-QUIZ-_20250625_182551_000.pdfhehe
errollnas3
 
PDF
WEEK3-Literary-Gennnnnnnnnnnnnnnnnres.pdf
MaybelynVergara
 
DOCX
Redefining Master Plans for creating sustainable cities-Jharkhand Conference...
JIT KUMAR GUPTA
 
PPTX
DEVELOPING-PARAGRAPHS.pptx-developing...
rania680036
 
DOCX
Ai vehicle traffic signal detector research proposal.docx
DavidNameza
 
PDF
CRAC- Adobe Photoshop CC 2016 (32 64Bit) Crack
utfefguu
 
PDF
AI Intervention in Design & Content Creation
YellowSlice1
 
PPTX
CompanyReviewTypeOfPowerpointThatIsColor
plukleomarigpuara
 
PPTX
condylar pptx.in relation to dental seurgery
abishekgowtham586
 
PPTX
BMC S6 M3 P1 building mATERIALS AND CONSTRUCTION.pptx
RizwanAlavi
 
PPTX
HIGH DENSITY CONCRETE-Concrete Technology
mayurbhandari2123
 
PPTX
(2) Cell Wall Inhibitors_Cephalosporins others.pptx
mkurdi133
 
PPT
Origin of the solar system acording .ppt
ReignLachica
 
PPTX
hall ppt 1 it for basic tamolet .pptx
ashishbehera64
 
PDF
Case Study on good and bad acoustics in auditorium
Disha Agrawal
 
PDF
The Role of Logos as Identity Shapers (IFIC Logo)
Md. Mehedi Hasan Asif
 
PPTX
sCREW cONVEYOR AUGER DAF SLUDGE SYSTEM TO
viksurs
 
PDF
🔴BUKTI KEMENANGAN HARI INI SELASA 08 JULI 2025 !!!🔴
GRAB
 
DOCX
Ai Vehicle traffic signal detector Literature Review.
DavidNameza
 
My_Engineering_Journey_Rahul_Rajbanshi.pptx
bikbikash24
 
PHILGOV-QUIZ-_20250625_182551_000.pdfhehe
errollnas3
 
WEEK3-Literary-Gennnnnnnnnnnnnnnnnres.pdf
MaybelynVergara
 
Redefining Master Plans for creating sustainable cities-Jharkhand Conference...
JIT KUMAR GUPTA
 
DEVELOPING-PARAGRAPHS.pptx-developing...
rania680036
 
Ai vehicle traffic signal detector research proposal.docx
DavidNameza
 
CRAC- Adobe Photoshop CC 2016 (32 64Bit) Crack
utfefguu
 
AI Intervention in Design & Content Creation
YellowSlice1
 
CompanyReviewTypeOfPowerpointThatIsColor
plukleomarigpuara
 
condylar pptx.in relation to dental seurgery
abishekgowtham586
 
BMC S6 M3 P1 building mATERIALS AND CONSTRUCTION.pptx
RizwanAlavi
 
HIGH DENSITY CONCRETE-Concrete Technology
mayurbhandari2123
 
(2) Cell Wall Inhibitors_Cephalosporins others.pptx
mkurdi133
 
Origin of the solar system acording .ppt
ReignLachica
 
hall ppt 1 it for basic tamolet .pptx
ashishbehera64
 
Case Study on good and bad acoustics in auditorium
Disha Agrawal
 
The Role of Logos as Identity Shapers (IFIC Logo)
Md. Mehedi Hasan Asif
 
sCREW cONVEYOR AUGER DAF SLUDGE SYSTEM TO
viksurs
 
🔴BUKTI KEMENANGAN HARI INI SELASA 08 JULI 2025 !!!🔴
GRAB
 
Ai Vehicle traffic signal detector Literature Review.
DavidNameza
 
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.