SlideShare a Scribd company logo
JAVA
Object Oriented Programming
Concepts
Topics for Today’s Session
Initially developed
by
James Gosling
at
Sun Microsystems
and
released
in
1995.
JAVA
Object Oriented Programming
 Object oriented Programming is a modern programming method
to design a program using Classes and Objects
Objects
Real world entities that has their own
properties and behaviours such as
Book, Chair, Car, Pen, Table, etc.,
Class
A class is a blueprint or prototype from
which objects are created.
 Major objective is to eliminate unfavorable features
encountered in Procedural approach
Procedural Vs Object Oriented ProgrammingProcedural Programming:
 It is known as POP
 Top Down Approach
 It deals with Algorithms
 Divided into functions
 It needs very less memory
 Doesn’s have Access Modifiers
 Data can move freely from function to function in the system
 It is Less Secure
Example: C, Fortran
Object Oriented Programming:
 It is known as OOP
 Bottom Up Approach
 It deals with data
 Divided into Objects
 It needs more memory that of POP
 Has Access Modifiers
 Objects can move & communicate with each other through member functions
 It is more Secure
Example: C++, JAVA, C#
Object Oriented Paradigm features
 Emphasis is on data rather than procedure.
 Programs are divided into what are known as objects.
 Data structures are designed such that they characterize the
objects.
 Methods that operate on the data of an object are tied
together in the data structure.
 Data is hidden and cannot be accessed by external functions.
 Objects may communicate with each other through methods.
 New data and methods can be easily added whenever
necessary.
 Follows bottom up approach in program design.
 First, the individual base elements of a program are specified.
 Then they are linked together to form larger sub sytems.
Applications of OOP
 Real-time systems
 Simulation and modeling
 Object-oriented databases
 Hypertext, hypermedia and expertext
 AI and expert systems
 Neural networks and parallel programming
 Decision support and office automation systems
What is Java?
 Java is a computing platform for application development
and an object-oriented,
 Class-based and Concurrent programming language
 It means many statements can be executed at the same time
instead of sequentially executing it.
 Java can run on all platforms and free to access.
 It is platform-independent
 Java is Simple, Secure, Robust, Complete Object oriented
and Platform Independent High level Language
 It is Portable and Multi-thread technology gives High
Performance.
 It supports concurrency
 means the code can be executed by multiple processes at
the same time.
Oops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in Java
OOPS Concepts
 OBJECT ORIENTED PROGRAMMING (OOP) is a programming
concept that works on the principles of abstraction, encapsulation,
inheritance, and polymorphism
 It allows users to create the objects that they want and then,
create methods to handle those objects.
 The basic concept of OOPs is to create objects, re-use them
throughout the program, and manipulate these objects to get
results.
 Object Oriented Programming popularly known as OOP, is used in a
modern programming language like Java
Object-oriented programming has several advantages over procedural
programming:
 OOP is faster and easier to execute
 OOP provides a clear structure for the programs
 OOP helps to keep the Java code DRY "Don't Repeat Yourself", and
makes the code easier to maintain, modify and debug
 OOP makes it possible to create full reusable applications with less
code and shorter development time
OOP simplifies software development and maintenance by
providing some concepts:
1. Object
2. Class
3. Inheritance
4. Polymorphism
5. Abstraction
6. Encapsulation
7. Dynamic Binding
8. Message Passing
Object:
 An instance of a class is known as a Object.
 Objects are the basic runtime entities in an object oriented
system.
 Real world entity that has state and behavior .
For example, a chair, pen, table, keyboard, bike, etc. It can be
physical or logical.
 An object contains an address and takes up
some space in memory.
 Each object contains data and code to
manipulate the data.
Representing an object
Class
 A class is a blueprint or prototype from which objects
are created.
 Collection of objects.
 It is a logical entity not the physical entity
 The class is a group of similar entities.
For example, if a class is “Expensive Cars”
then objects like Mercedes, BMW, Toyota, etc.
Its properties(data) can be - price, model or speed etc.,
Methods - driving, reverse, braking etc.
Two instances of the class Student
 Classes and objects are the two main aspects of object-
oriented programming.
 So, a class is a template for objects, and an object is an
instance of a class.
 When the individual objects are created, they inherit all
the variables and methods from the class.
Data Abstraction
 Hiding internal details and showing functionality is known
as abstraction.
For example phone call, we don't know the internal
processing.
 Abstraction refers to the act of representing essential
features without including the background details or
explanations.
 Classes use the concept of abstraction and they are known
as abstract data types (ADT).
 Classes are defined as a list of abstract attributes such as
size, weight and cost and methods that operate on these
attributes.
 The technique of creating new data types that are well
suited to an application to be programmed is known as Data
Abstraction
 In Java, we use abstract class and interface to achieve
abstraction.
Encapsulation
 Encapsulation means “Combining”.
 The wrapping up of data and methods into a
single unit (called class) is known as
Encapsulation.
For example - in school, a student cannot exist
without a class.
Capsule
Inheritance
 Inheritance involves the creation of new classes (derived classes) from the
existing ones ( base classes ).
 It is the process by which object of one class acquire the properties of
another class.
 It supports the concept of hierarchical classification.
Example: The bird Robin is a part of the class flying bird which is
again a part of the bird
 Provides code reusability.
 Used to achieve runtime
Polymorphism
o Single Inheritance refers to deriving a class from a single
class.
o A class is derived from more than one base class is known as
Multiple inherence.
Polymorphism
 It is a Greek term, “Poly” means “many” and “morph” means
“form”.
 Polymorphism means the ability to take more than one form.
 When one task is performed by different ways
 An operation may exhibit different behaviors in different
instances.
 The behavior depends upon
the types of data used in the
operation.
 There are 2 types of Polymorphism:
1. Compile-time Polymorphism (Method overloading / Static)
2. Runtime Polymorphism (Method Overriding / Dynamic)
Method overloading
 Having multiple methods with same name but with
different signature (number, type and order of
parameters).
Method Overriding
 When a subclass contains a method with the same name
and signature as in the super class .
Dynamic Binding
 Binding refers the linking of a procedure call to the code
to be executed in response to the call.
 Dynamic binding means that the code associated with a
given procedure call is not known until the time of the
call at runtime.
 It is associated with polymorphism & inheritance.
Message Passing
 A Message for an object is a request for execution of a
procedure .
 It is the process of invoking an operation on an object.
 It involves the name of the object, the name of the
method (message) and the information to be sent.
For Example: Employee. salary (name);
Here, Employee is the object,
salary is the message and
name is the parameter that contains information.
Summary
Conclusion
 In this lesson you learnt about
 Object Oriented Programming
 Procedural Vs Object Oriented Programming
 Object Oriented Paradigm
 Applications of OOP
 What is Java?
 OOPs Concepts
Oops concepts || Object Oriented Programming Concepts in Java

More Related Content

What's hot (20)

PDF
Arrays in Java
Naz Abdalla
 
PPTX
Object oriented programming
Amit Soni (CTFL)
 
PPTX
Java Tokens
Madishetty Prathibha
 
PPS
Java Exception handling
kamal kotecha
 
PPTX
Java Data Types
Spotle.ai
 
PPTX
Association agggregation and composition
baabtra.com - No. 1 supplier of quality freshers
 
PPT
Java interfaces
Raja Sekhar
 
PPTX
Java abstract class & abstract methods
Shubham Dwivedi
 
PPTX
Constructor in java
SIVASHANKARIRAJAN
 
PPTX
OOP Introduction with java programming language
Md.Al-imran Roton
 
PPT
Basic concept of OOP's
Prof. Dr. K. Adisesha
 
PPTX
OOPS In JAVA.pptx
Sachin33417
 
PPTX
Arrays in Java
Abhilash Nair
 
PPT
Java buzzwords
ramesh517
 
PPTX
Constructor in java
Pavith Gunasekara
 
PDF
C++ OOPS Concept
Boopathi K
 
PPTX
Static keyword ppt
Vinod Kumar
 
PPTX
MULTI THREADING IN JAVA
VINOTH R
 
PPTX
Object Oriented Programming
Iqra khalil
 
PPT
Abstract class in java
Lovely Professional University
 
Arrays in Java
Naz Abdalla
 
Object oriented programming
Amit Soni (CTFL)
 
Java Exception handling
kamal kotecha
 
Java Data Types
Spotle.ai
 
Association agggregation and composition
baabtra.com - No. 1 supplier of quality freshers
 
Java interfaces
Raja Sekhar
 
Java abstract class & abstract methods
Shubham Dwivedi
 
Constructor in java
SIVASHANKARIRAJAN
 
OOP Introduction with java programming language
Md.Al-imran Roton
 
Basic concept of OOP's
Prof. Dr. K. Adisesha
 
OOPS In JAVA.pptx
Sachin33417
 
Arrays in Java
Abhilash Nair
 
Java buzzwords
ramesh517
 
Constructor in java
Pavith Gunasekara
 
C++ OOPS Concept
Boopathi K
 
Static keyword ppt
Vinod Kumar
 
MULTI THREADING IN JAVA
VINOTH R
 
Object Oriented Programming
Iqra khalil
 
Abstract class in java
Lovely Professional University
 

Similar to Oops concepts || Object Oriented Programming Concepts in Java (20)

PPT
Basic Java Concept - Practical Oriented Methodologies
SakthiVinayagam5
 
PPTX
Birasa 1
Niyitegekabilly
 
PPTX
JAVA PROGRAMMING
Niyitegekabilly
 
PPTX
JAVA PROGRAMMINGD
Niyitegekabilly
 
PPTX
UNIT I OOP AND JAVA FUNDAMENTALS CONSTRUCTOR
mohanrajm63
 
PPTX
JAVA-PPT'S-complete-chrome.pptx
KunalYadav65140
 
PPTX
JAVA-PPT'S.pptx
RaazIndia
 
PDF
JAVA-PPT'S.pdf
AnmolVerma363503
 
PPTX
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
berihun18
 
PDF
Ah java-ppt2
Haja Abdul Khader A
 
PPTX
Introduction to Java -unit-1
RubaNagarajan
 
PPT
Unit 1- Basic concept of object-oriented-programming.ppt
hannahroseline2
 
PPTX
1 unit (oops)
Jay Patel
 
PDF
1unit-120324103142-phpapp02.pdf
SahajShrimal1
 
PDF
Lecture_1___Introduction_to_OOP.pdf.pdf
AngelaClarito1
 
PPTX
INTRODUCTION TO JAVA
RAMALINGHAM KRISHNAMOORTHY
 
PDF
Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...
Sakthi Durai
 
PDF
Java Programming Paradigms Chapter 1
Sakthi Durai
 
PPTX
OOPS in Java
Zeeshan Khan
 
PPT
Share Unit 1- Basic concept of object-oriented-programming.ppt
hannahrroselin95
 
Basic Java Concept - Practical Oriented Methodologies
SakthiVinayagam5
 
Birasa 1
Niyitegekabilly
 
JAVA PROGRAMMING
Niyitegekabilly
 
JAVA PROGRAMMINGD
Niyitegekabilly
 
UNIT I OOP AND JAVA FUNDAMENTALS CONSTRUCTOR
mohanrajm63
 
JAVA-PPT'S-complete-chrome.pptx
KunalYadav65140
 
JAVA-PPT'S.pptx
RaazIndia
 
JAVA-PPT'S.pdf
AnmolVerma363503
 
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
berihun18
 
Ah java-ppt2
Haja Abdul Khader A
 
Introduction to Java -unit-1
RubaNagarajan
 
Unit 1- Basic concept of object-oriented-programming.ppt
hannahroseline2
 
1 unit (oops)
Jay Patel
 
1unit-120324103142-phpapp02.pdf
SahajShrimal1
 
Lecture_1___Introduction_to_OOP.pdf.pdf
AngelaClarito1
 
INTRODUCTION TO JAVA
RAMALINGHAM KRISHNAMOORTHY
 
Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...
Sakthi Durai
 
Java Programming Paradigms Chapter 1
Sakthi Durai
 
OOPS in Java
Zeeshan Khan
 
Share Unit 1- Basic concept of object-oriented-programming.ppt
hannahrroselin95
 
Ad

More from Madishetty Prathibha (13)

PPTX
Object Oriented programming - Introduction
Madishetty Prathibha
 
PPTX
Access modifiers in java
Madishetty Prathibha
 
PPTX
Constructor in java
Madishetty Prathibha
 
PPTX
Control statements in java
Madishetty Prathibha
 
PPTX
Classes objects in java
Madishetty Prathibha
 
PPTX
Structure of java program diff c- cpp and java
Madishetty Prathibha
 
PPTX
Operators in java
Madishetty Prathibha
 
PPTX
Types of datastructures
Madishetty Prathibha
 
PPTX
Introduction to algorithms
Madishetty Prathibha
 
PDF
Java data types, variables and jvm
Madishetty Prathibha
 
PPTX
Introduction to data structures (ss)
Madishetty Prathibha
 
PPT
Java features
Madishetty Prathibha
 
PPSX
Introduction of java
Madishetty Prathibha
 
Object Oriented programming - Introduction
Madishetty Prathibha
 
Access modifiers in java
Madishetty Prathibha
 
Constructor in java
Madishetty Prathibha
 
Control statements in java
Madishetty Prathibha
 
Classes objects in java
Madishetty Prathibha
 
Structure of java program diff c- cpp and java
Madishetty Prathibha
 
Operators in java
Madishetty Prathibha
 
Types of datastructures
Madishetty Prathibha
 
Introduction to algorithms
Madishetty Prathibha
 
Java data types, variables and jvm
Madishetty Prathibha
 
Introduction to data structures (ss)
Madishetty Prathibha
 
Java features
Madishetty Prathibha
 
Introduction of java
Madishetty Prathibha
 
Ad

Recently uploaded (20)

PPTX
PLANNING FOR EMERGENCY AND DISASTER MANAGEMENT ppt.pptx
PRADEEP ABOTHU
 
PPTX
How to Create & Manage Stages in Odoo 18 Helpdesk
Celine George
 
PPTX
The Gift of the Magi by O Henry-A Story of True Love, Sacrifice, and Selfless...
Beena E S
 
PDF
Andreas Schleicher_Teaching Compass_Education 2040.pdf
EduSkills OECD
 
PDF
Lesson 1 : Science and the Art of Geography Ecosystem
marvinnbustamante1
 
PDF
Lesson 1 - Nature of Inquiry and Research.pdf
marvinnbustamante1
 
PPTX
Exploring Linear and Angular Quantities and Ergonomic Design.pptx
AngeliqueTolentinoDe
 
PDF
AI-assisted IP-Design lecture from the MIPLM 2025
MIPLM
 
PDF
Wikinomics How Mass Collaboration Changes Everything Don Tapscott
wcsqyzf5909
 
PPTX
How to Configure Refusal of Applicants in Odoo 18 Recruitment
Celine George
 
PPTX
Connecting Linear and Angular Quantities in Human Movement.pptx
AngeliqueTolentinoDe
 
PPTX
Marketing Management PPT Unit 1 and Unit 2.pptx
Sri Ramakrishna College of Arts and science
 
PDF
The Power of Compound Interest (Stanford Initiative for Financial Decision-Ma...
Stanford IFDM
 
DOCX
Lesson 1 - Nature and Inquiry of Research
marvinnbustamante1
 
PDF
CAD25 Gbadago and Fafa Presentation Revised-Aston Business School, UK.pdf
Kweku Zurek
 
PPTX
Life and Career Skills Lesson 2.pptxProtective and Risk Factors of Late Adole...
ryangabrielcatalon40
 
PPTX
Elo the Hero is an story about a young boy who became hero.
TeacherEmily1
 
PDF
Lean IP - Lecture by Dr Oliver Baldus at the MIPLM 2025
MIPLM
 
PDF
IMPORTANT GUIDELINES FOR M.Sc.ZOOLOGY DISSERTATION
raviralanaresh2
 
PDF
Free eBook ~100 Common English Proverbs (ebook) pdf.pdf
OH TEIK BIN
 
PLANNING FOR EMERGENCY AND DISASTER MANAGEMENT ppt.pptx
PRADEEP ABOTHU
 
How to Create & Manage Stages in Odoo 18 Helpdesk
Celine George
 
The Gift of the Magi by O Henry-A Story of True Love, Sacrifice, and Selfless...
Beena E S
 
Andreas Schleicher_Teaching Compass_Education 2040.pdf
EduSkills OECD
 
Lesson 1 : Science and the Art of Geography Ecosystem
marvinnbustamante1
 
Lesson 1 - Nature of Inquiry and Research.pdf
marvinnbustamante1
 
Exploring Linear and Angular Quantities and Ergonomic Design.pptx
AngeliqueTolentinoDe
 
AI-assisted IP-Design lecture from the MIPLM 2025
MIPLM
 
Wikinomics How Mass Collaboration Changes Everything Don Tapscott
wcsqyzf5909
 
How to Configure Refusal of Applicants in Odoo 18 Recruitment
Celine George
 
Connecting Linear and Angular Quantities in Human Movement.pptx
AngeliqueTolentinoDe
 
Marketing Management PPT Unit 1 and Unit 2.pptx
Sri Ramakrishna College of Arts and science
 
The Power of Compound Interest (Stanford Initiative for Financial Decision-Ma...
Stanford IFDM
 
Lesson 1 - Nature and Inquiry of Research
marvinnbustamante1
 
CAD25 Gbadago and Fafa Presentation Revised-Aston Business School, UK.pdf
Kweku Zurek
 
Life and Career Skills Lesson 2.pptxProtective and Risk Factors of Late Adole...
ryangabrielcatalon40
 
Elo the Hero is an story about a young boy who became hero.
TeacherEmily1
 
Lean IP - Lecture by Dr Oliver Baldus at the MIPLM 2025
MIPLM
 
IMPORTANT GUIDELINES FOR M.Sc.ZOOLOGY DISSERTATION
raviralanaresh2
 
Free eBook ~100 Common English Proverbs (ebook) pdf.pdf
OH TEIK BIN
 

Oops concepts || Object Oriented Programming Concepts in Java

  • 3. Initially developed by James Gosling at Sun Microsystems and released in 1995. JAVA
  • 4. Object Oriented Programming  Object oriented Programming is a modern programming method to design a program using Classes and Objects Objects Real world entities that has their own properties and behaviours such as Book, Chair, Car, Pen, Table, etc., Class A class is a blueprint or prototype from which objects are created.  Major objective is to eliminate unfavorable features encountered in Procedural approach
  • 5. Procedural Vs Object Oriented ProgrammingProcedural Programming:  It is known as POP  Top Down Approach  It deals with Algorithms  Divided into functions  It needs very less memory  Doesn’s have Access Modifiers  Data can move freely from function to function in the system  It is Less Secure Example: C, Fortran Object Oriented Programming:  It is known as OOP  Bottom Up Approach  It deals with data  Divided into Objects  It needs more memory that of POP  Has Access Modifiers  Objects can move & communicate with each other through member functions  It is more Secure Example: C++, JAVA, C#
  • 6. Object Oriented Paradigm features  Emphasis is on data rather than procedure.  Programs are divided into what are known as objects.  Data structures are designed such that they characterize the objects.  Methods that operate on the data of an object are tied together in the data structure.  Data is hidden and cannot be accessed by external functions.  Objects may communicate with each other through methods.  New data and methods can be easily added whenever necessary.  Follows bottom up approach in program design.  First, the individual base elements of a program are specified.  Then they are linked together to form larger sub sytems.
  • 7. Applications of OOP  Real-time systems  Simulation and modeling  Object-oriented databases  Hypertext, hypermedia and expertext  AI and expert systems  Neural networks and parallel programming  Decision support and office automation systems
  • 8. What is Java?  Java is a computing platform for application development and an object-oriented,  Class-based and Concurrent programming language  It means many statements can be executed at the same time instead of sequentially executing it.  Java can run on all platforms and free to access.  It is platform-independent  Java is Simple, Secure, Robust, Complete Object oriented and Platform Independent High level Language  It is Portable and Multi-thread technology gives High Performance.  It supports concurrency  means the code can be executed by multiple processes at the same time.
  • 11. OOPS Concepts  OBJECT ORIENTED PROGRAMMING (OOP) is a programming concept that works on the principles of abstraction, encapsulation, inheritance, and polymorphism  It allows users to create the objects that they want and then, create methods to handle those objects.  The basic concept of OOPs is to create objects, re-use them throughout the program, and manipulate these objects to get results.  Object Oriented Programming popularly known as OOP, is used in a modern programming language like Java Object-oriented programming has several advantages over procedural programming:  OOP is faster and easier to execute  OOP provides a clear structure for the programs  OOP helps to keep the Java code DRY "Don't Repeat Yourself", and makes the code easier to maintain, modify and debug  OOP makes it possible to create full reusable applications with less code and shorter development time
  • 12. OOP simplifies software development and maintenance by providing some concepts: 1. Object 2. Class 3. Inheritance 4. Polymorphism 5. Abstraction 6. Encapsulation 7. Dynamic Binding 8. Message Passing
  • 13. Object:  An instance of a class is known as a Object.  Objects are the basic runtime entities in an object oriented system.  Real world entity that has state and behavior . For example, a chair, pen, table, keyboard, bike, etc. It can be physical or logical.  An object contains an address and takes up some space in memory.  Each object contains data and code to manipulate the data. Representing an object
  • 14. Class  A class is a blueprint or prototype from which objects are created.  Collection of objects.  It is a logical entity not the physical entity  The class is a group of similar entities. For example, if a class is “Expensive Cars” then objects like Mercedes, BMW, Toyota, etc. Its properties(data) can be - price, model or speed etc., Methods - driving, reverse, braking etc. Two instances of the class Student
  • 15.  Classes and objects are the two main aspects of object- oriented programming.  So, a class is a template for objects, and an object is an instance of a class.  When the individual objects are created, they inherit all the variables and methods from the class.
  • 16. Data Abstraction  Hiding internal details and showing functionality is known as abstraction. For example phone call, we don't know the internal processing.  Abstraction refers to the act of representing essential features without including the background details or explanations.  Classes use the concept of abstraction and they are known as abstract data types (ADT).  Classes are defined as a list of abstract attributes such as size, weight and cost and methods that operate on these attributes.  The technique of creating new data types that are well suited to an application to be programmed is known as Data Abstraction  In Java, we use abstract class and interface to achieve abstraction.
  • 17. Encapsulation  Encapsulation means “Combining”.  The wrapping up of data and methods into a single unit (called class) is known as Encapsulation. For example - in school, a student cannot exist without a class. Capsule
  • 18. Inheritance  Inheritance involves the creation of new classes (derived classes) from the existing ones ( base classes ).  It is the process by which object of one class acquire the properties of another class.  It supports the concept of hierarchical classification. Example: The bird Robin is a part of the class flying bird which is again a part of the bird  Provides code reusability.  Used to achieve runtime Polymorphism
  • 19. o Single Inheritance refers to deriving a class from a single class. o A class is derived from more than one base class is known as Multiple inherence.
  • 20. Polymorphism  It is a Greek term, “Poly” means “many” and “morph” means “form”.  Polymorphism means the ability to take more than one form.  When one task is performed by different ways  An operation may exhibit different behaviors in different instances.  The behavior depends upon the types of data used in the operation.
  • 21.  There are 2 types of Polymorphism: 1. Compile-time Polymorphism (Method overloading / Static) 2. Runtime Polymorphism (Method Overriding / Dynamic) Method overloading  Having multiple methods with same name but with different signature (number, type and order of parameters). Method Overriding  When a subclass contains a method with the same name and signature as in the super class .
  • 22. Dynamic Binding  Binding refers the linking of a procedure call to the code to be executed in response to the call.  Dynamic binding means that the code associated with a given procedure call is not known until the time of the call at runtime.  It is associated with polymorphism & inheritance.
  • 23. Message Passing  A Message for an object is a request for execution of a procedure .  It is the process of invoking an operation on an object.  It involves the name of the object, the name of the method (message) and the information to be sent. For Example: Employee. salary (name); Here, Employee is the object, salary is the message and name is the parameter that contains information.
  • 25. Conclusion  In this lesson you learnt about  Object Oriented Programming  Procedural Vs Object Oriented Programming  Object Oriented Paradigm  Applications of OOP  What is Java?  OOPs Concepts