SlideShare a Scribd company logo
OOPS in Java
 Characteristics:
 Emphasis is on doing things
(algorithms)
 Large programs are divided into
smaller functions
 Most of the functions share global
data
 Data moves openly across the
system from function to function
 Functions transform data from one
form to another
 Uses top-down approach to program
design
Procedural Language(POP) - ex. ‘C’
 Drawbacks:
 As functions openly access global data, new
programmer could easily corrupt data accidentally
 Can easily access data from one function in
another function, no protection!
 In large projects, it becomes difficult to identify
what data is being used by which functions
 If program is modified to handle new data, all
functions need to be modified to access data
 Functions transform data from one form to
another
 Does not model real-time problems very well
Procedural Languages - Drawbacks
Difference between POP & OOP’s
Top-down approach – ‘C’
 Overview of system is formulated
 For each part; refine (+add) details
 Keep adding details everywhere
until system is ready
 Large program broken
into smaller functions
 Complex code
 Global data focused
 Limited; to no code reuse
Bottom-up approach – Java
 Describe entities then how they
interact
 Start with concrete business case,
proceed to implementation
 Easy to develop
 Unit test it here, and validate now
 Easy to change & modify later
 No duplication of code
 Reuse, wherever needed
Object Oriented - Advantages
 Code reuse & recycle
 Improved s/w development productivity
 Improved software maintainability
 Lesser development time
 Reduced cost of development
 Higher quality software
 Encapsulation
Object Oriented Concepts
 Class
 Object
 Inheritance
 Abstraction
 Encapsulation
 Polymorphism
Class – OO Concepts
 The basic unit of OOP’s is a ‘class’.
 Class encapsulates both the static attributes and
dynamic behaviors within a "box“
 Class combines “data structures” + “entity’s algorithm”
 A class is a blueprint from which objects get created.
 Class defines the state and behavior, typically, of a real-
world object
Class – OO Concepts
 A class is a definition of objects of the same kind.
 Class is a blueprint, template, or prototype that defines
and describes the static attributes and dynamic
behaviors common to all objects of the same kind.
Object – OO Concepts
 An object is a realization of
a particular item of a class.
 All instances (objects) of a
class have same properties
as in class definition
 Ex. Define a class called
Student, create 3
instances: “Peter”, “Paul”
& “Mary”.
Inheritance – OO Concepts
 Inheritance enables new
objects to take on the
properties of existing
objects.
 A class that is used as
the basis for inheritance
is called a superclass or
base class.
 A class that inherits from
a superclass is called a
subclass or derived class.
Abstraction – OO Concepts
 Hide internal details
only show essential data
about object to reduce
complexity and increase
efficiency
 Abstraction is selecting
data from a larger pool to
show only the relevant
details of the object
Encapsulation – OO Concepts
 Also called ‘data binding’
 Hide the state (value) of
attributes within a class,
preventing unauthorized
direct access to it
 Control access to state of
attributes + methods
 Bundling data and methods
together in a class
Polymorphism – OO Concepts
 Generally, the ability to
appear in many forms
 Ability to process objects
differently depending on
their data types or class
 Single interface to entities
of different types
 Instances (subclass)
derived from superclass
 Static @ compile time
 Dynamic @ run time
Compile & Run-time Polymorphism
Instance – OO Concepts
 An ‘instance’ is a unique copy of
a class, that represents an
object.
 When a new instance of a class
is created, the JVM will allocate
space in memory for that class
instance.
 ‘Instance ‘and ‘object’ can be
used interchangeably
State – OO Concepts
 An object has state (data) and
behavior (functions).
 Is the instances (variables)
inside the object that contains
the data.
 State is the values of its
attributes.
Attribute – OO Concepts
 An Attribute is a named
property of a class.
 It has a type.
 It describes the range of values
that this property may hold.
 A object can contain any
number of attributes
Method (Operation) – OO Concepts
 The behaviour of an object is
defined by its methods, which
are the functions and
subroutines defined within the
object class.
 An operation that an object can
perform.
Message Passing – OO Concepts
 Message passing is the
communication between
processes.
 Message passing is a form of
communication used in object-
oriented programming.
 Communications are completed
by the sending of messages
(functions and data) to
recipients.
Generalization – OO Concepts
 The generalized entities contain
the properties of all the
generalized entities
 Also called as the ‘superclass’
 Example: Pigeon, House
sparrow, Crow and Dove can all
be generalized as ‘Birds’.
Specialization – OO Concepts
 Specialization is the opposite of
generalization.
 In specialization, a group of entities is
divided into sub-groups based on
their characteristics.
 For example: A ‘Person’ has name,
date of birth, gender, etc. These
properties are common in all persons,
human beings.
 But in a company, persons can be
identified as employee, employer,
customer, or vendor, based on what
role they play in the company.
History of Java
 1990: ‘Oak’
 To control microprocessors, embedded in customer
products
 Oak needed to be:
 Platform Independent
 Extremely reliable
 Compact
 1993: ‘Java’
 Internet and web exploration
 Internet applications
 1995: ‘Java 1.0’
James Gosling:
Inventor of Java
Features of Java
 Compile & Interpret: Java compiler converts Java Source code
into Java bytecode. Java interpreter converts bytecode into
machine code
 Portable & Platform Independent: Java programs are easily
transferred from one computer to another, bytecode
interpreted on JVM
 Object Oriented: Java is 100% object oriented language
 Robust: Java supports automatic memory management and
exception handling.
 Distributed: Has the ability to share & access data remotely
Features of Java
 Simple: Easy to understand syntax, doesn't support pointers,
operator overloading, multiple inheritance
 Multithreaded: Java has the ability to write programs that do
multiple tasks simultaneously
 Dynamic: Java allocates memory at runtime for classes,
methods and objects as and when required
References
 https://www.javatpoint.com/java-oops-concepts
 https://beginnersbook.com/2013/04/oops-concepts/
 https://www.guru99.com/java-oops-concept.html
 https://www.journaldev.com/12496/oops-concepts-
java-example
Happy Oops Programming!!
Thank you!

More Related Content

PPTX
OOPS In JAVA.pptx
PPTX
OOP concepts -in-Python programming language
PDF
JavaScript - Chapter 11 - Events
PDF
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
PPT
standard template library(STL) in C++
PPTX
Type casting in java
PPTX
Java awt (abstract window toolkit)
PPT
Object Oriented Design
OOPS In JAVA.pptx
OOP concepts -in-Python programming language
JavaScript - Chapter 11 - Events
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
standard template library(STL) in C++
Type casting in java
Java awt (abstract window toolkit)
Object Oriented Design

What's hot (20)

PPT
Object Oriented Analysis and Design
PPTX
Object Oriented Programming In JavaScript
PPT
Java EE Introduction
PPTX
Java swing
PPSX
Data Types & Variables in JAVA
ODP
OOP java
PPTX
Object Oriented Programming
PPT
Object-oriented concepts
PPTX
OOPs in Java
PPTX
Operators in java presentation
PPTX
Introduction to Object Oriented Programming
PPTX
Object oriented programming in python
PPTX
Static keyword ppt
PDF
Object oriented software engineering concepts
PPTX
Java - Collections framework
PPT
Java: GUI
PPTX
Sqlite
PPTX
C# classes objects
PPTX
Object oriented programming
Object Oriented Analysis and Design
Object Oriented Programming In JavaScript
Java EE Introduction
Java swing
Data Types & Variables in JAVA
OOP java
Object Oriented Programming
Object-oriented concepts
OOPs in Java
Operators in java presentation
Introduction to Object Oriented Programming
Object oriented programming in python
Static keyword ppt
Object oriented software engineering concepts
Java - Collections framework
Java: GUI
Sqlite
C# classes objects
Object oriented programming
Ad

Similar to OOPS in Java (20)

PPTX
Birasa 1
PPTX
JAVA PROGRAMMING
PPTX
JAVA PROGRAMMINGD
PPTX
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
DOCX
Object Oriented Programming All Unit Notes
PDF
Oops concepts || Object Oriented Programming Concepts in Java
PPTX
General oop concept
PPT
Unit 1- Basic concept of object-oriented-programming.ppt
PPT
Share Unit 1- Basic concept of object-oriented-programming.ppt
PPTX
UNIT - 1 Java Fundamentals, Basics of java
PPTX
1 intro
PDF
2.oop concept
PPTX
Software_Engineering_Presentation (1).pptx
PPT
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
PPTX
Bab satu
PDF
babsatu-140703233001-phpapp666666601.pdf
PDF
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
PPTX
DOC-20210303-WA0017..pptx,coding stuff in c
PPTX
Intro to object oriented programming.pptx
PPTX
Introduction to Java -unit-1
Birasa 1
JAVA PROGRAMMING
JAVA PROGRAMMINGD
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
Object Oriented Programming All Unit Notes
Oops concepts || Object Oriented Programming Concepts in Java
General oop concept
Unit 1- Basic concept of object-oriented-programming.ppt
Share Unit 1- Basic concept of object-oriented-programming.ppt
UNIT - 1 Java Fundamentals, Basics of java
1 intro
2.oop concept
Software_Engineering_Presentation (1).pptx
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
Bab satu
babsatu-140703233001-phpapp666666601.pdf
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
DOC-20210303-WA0017..pptx,coding stuff in c
Intro to object oriented programming.pptx
Introduction to Java -unit-1
Ad

More from Zeeshan Khan (12)

PPTX
Apache kafka
PDF
Spring security4.x
PPTX
Micro services overview
PDF
XML / WEB SERVICES & RESTful Services
PDF
Manual Testing
PDF
Collection framework (completenotes) zeeshan
PDF
JUnit with_mocking
PPTX
PPTX
Introduction to BIG DATA
PPTX
Big data
PPT
Android application development
PPTX
Cyber crime
Apache kafka
Spring security4.x
Micro services overview
XML / WEB SERVICES & RESTful Services
Manual Testing
Collection framework (completenotes) zeeshan
JUnit with_mocking
Introduction to BIG DATA
Big data
Android application development
Cyber crime

Recently uploaded (20)

PDF
System and Network Administration Chapter 2
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PPTX
Transform Your Business with a Software ERP System
PDF
System and Network Administraation Chapter 3
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Digital Strategies for Manufacturing Companies
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
System and Network Administration Chapter 2
2025 Textile ERP Trends: SAP, Odoo & Oracle
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Understanding Forklifts - TECH EHS Solution
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Design an Analysis of Algorithms I-SECS-1021-03
Odoo POS Development Services by CandidRoot Solutions
VVF-Customer-Presentation2025-Ver1.9.pptx
How to Choose the Right IT Partner for Your Business in Malaysia
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Wondershare Filmora 15 Crack With Activation Key [2025
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Design an Analysis of Algorithms II-SECS-1021-03
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Transform Your Business with a Software ERP System
System and Network Administraation Chapter 3
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Digital Strategies for Manufacturing Companies
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...

OOPS in Java

  • 2.  Characteristics:  Emphasis is on doing things (algorithms)  Large programs are divided into smaller functions  Most of the functions share global data  Data moves openly across the system from function to function  Functions transform data from one form to another  Uses top-down approach to program design Procedural Language(POP) - ex. ‘C’
  • 3.  Drawbacks:  As functions openly access global data, new programmer could easily corrupt data accidentally  Can easily access data from one function in another function, no protection!  In large projects, it becomes difficult to identify what data is being used by which functions  If program is modified to handle new data, all functions need to be modified to access data  Functions transform data from one form to another  Does not model real-time problems very well Procedural Languages - Drawbacks
  • 5. Top-down approach – ‘C’  Overview of system is formulated  For each part; refine (+add) details  Keep adding details everywhere until system is ready  Large program broken into smaller functions  Complex code  Global data focused  Limited; to no code reuse
  • 6. Bottom-up approach – Java  Describe entities then how they interact  Start with concrete business case, proceed to implementation  Easy to develop  Unit test it here, and validate now  Easy to change & modify later  No duplication of code  Reuse, wherever needed
  • 7. Object Oriented - Advantages  Code reuse & recycle  Improved s/w development productivity  Improved software maintainability  Lesser development time  Reduced cost of development  Higher quality software  Encapsulation
  • 8. Object Oriented Concepts  Class  Object  Inheritance  Abstraction  Encapsulation  Polymorphism
  • 9. Class – OO Concepts  The basic unit of OOP’s is a ‘class’.  Class encapsulates both the static attributes and dynamic behaviors within a "box“  Class combines “data structures” + “entity’s algorithm”  A class is a blueprint from which objects get created.  Class defines the state and behavior, typically, of a real- world object
  • 10. Class – OO Concepts  A class is a definition of objects of the same kind.  Class is a blueprint, template, or prototype that defines and describes the static attributes and dynamic behaviors common to all objects of the same kind.
  • 11. Object – OO Concepts  An object is a realization of a particular item of a class.  All instances (objects) of a class have same properties as in class definition  Ex. Define a class called Student, create 3 instances: “Peter”, “Paul” & “Mary”.
  • 12. Inheritance – OO Concepts  Inheritance enables new objects to take on the properties of existing objects.  A class that is used as the basis for inheritance is called a superclass or base class.  A class that inherits from a superclass is called a subclass or derived class.
  • 13. Abstraction – OO Concepts  Hide internal details only show essential data about object to reduce complexity and increase efficiency  Abstraction is selecting data from a larger pool to show only the relevant details of the object
  • 14. Encapsulation – OO Concepts  Also called ‘data binding’  Hide the state (value) of attributes within a class, preventing unauthorized direct access to it  Control access to state of attributes + methods  Bundling data and methods together in a class
  • 15. Polymorphism – OO Concepts  Generally, the ability to appear in many forms  Ability to process objects differently depending on their data types or class  Single interface to entities of different types  Instances (subclass) derived from superclass  Static @ compile time  Dynamic @ run time
  • 16. Compile & Run-time Polymorphism
  • 17. Instance – OO Concepts  An ‘instance’ is a unique copy of a class, that represents an object.  When a new instance of a class is created, the JVM will allocate space in memory for that class instance.  ‘Instance ‘and ‘object’ can be used interchangeably
  • 18. State – OO Concepts  An object has state (data) and behavior (functions).  Is the instances (variables) inside the object that contains the data.  State is the values of its attributes.
  • 19. Attribute – OO Concepts  An Attribute is a named property of a class.  It has a type.  It describes the range of values that this property may hold.  A object can contain any number of attributes
  • 20. Method (Operation) – OO Concepts  The behaviour of an object is defined by its methods, which are the functions and subroutines defined within the object class.  An operation that an object can perform.
  • 21. Message Passing – OO Concepts  Message passing is the communication between processes.  Message passing is a form of communication used in object- oriented programming.  Communications are completed by the sending of messages (functions and data) to recipients.
  • 22. Generalization – OO Concepts  The generalized entities contain the properties of all the generalized entities  Also called as the ‘superclass’  Example: Pigeon, House sparrow, Crow and Dove can all be generalized as ‘Birds’.
  • 23. Specialization – OO Concepts  Specialization is the opposite of generalization.  In specialization, a group of entities is divided into sub-groups based on their characteristics.  For example: A ‘Person’ has name, date of birth, gender, etc. These properties are common in all persons, human beings.  But in a company, persons can be identified as employee, employer, customer, or vendor, based on what role they play in the company.
  • 24. History of Java  1990: ‘Oak’  To control microprocessors, embedded in customer products  Oak needed to be:  Platform Independent  Extremely reliable  Compact  1993: ‘Java’  Internet and web exploration  Internet applications  1995: ‘Java 1.0’ James Gosling: Inventor of Java
  • 25. Features of Java  Compile & Interpret: Java compiler converts Java Source code into Java bytecode. Java interpreter converts bytecode into machine code  Portable & Platform Independent: Java programs are easily transferred from one computer to another, bytecode interpreted on JVM  Object Oriented: Java is 100% object oriented language  Robust: Java supports automatic memory management and exception handling.  Distributed: Has the ability to share & access data remotely
  • 26. Features of Java  Simple: Easy to understand syntax, doesn't support pointers, operator overloading, multiple inheritance  Multithreaded: Java has the ability to write programs that do multiple tasks simultaneously  Dynamic: Java allocates memory at runtime for classes, methods and objects as and when required
  • 27. References  https://www.javatpoint.com/java-oops-concepts  https://beginnersbook.com/2013/04/oops-concepts/  https://www.guru99.com/java-oops-concept.html  https://www.journaldev.com/12496/oops-concepts- java-example