SlideShare a Scribd company logo
OOPS CONCEPTS
Introduction
• Object oriented programming is a paradigm that provides many concepts such
as inheritance, polymorphism, abstraction, encapsulation.
• Simula is considered as the first object-oriented programming language
• The main aim of oops is to bind together the data and the functions that
operate on them so that no other part of the code can access this data except
that functions.
OOPS Concepts are
• Class
• Object
• Method and method passing
• Pillars of OOPs
• Abstraction
• Encapsulation
• Inheritance
• polymorphism
CLASS
• A class is a user defined blueprint or prototype from which objects are
created.
• It represents the set of properties or methods that are common to all objects of
one type.
• In general class declarations can include these components, in order
• Modifier
• Class name
• Body
OBJECT
• Object is a basic unit of object oriented programming and represents the real
life entities
• A typical java program creates many objects, which as you know, interact by
invoking methods.
• An object consist of
• State
• Behaviour
• Identity
• method
PILLARS OF OOP’s
• ABSTRACTION
• ENCAPSULATION
• POLYMORPHISM
• INHERITANCE
ABSTRACTION
• Data abstraction is the property by virtue of which only the essential details
are displayed to the user.
• Data abstraction may also be defined as the process of identifying only the
required characteristics of an object ignoring the irrelevant details.
• The properties and behaviours of an object differentiate it from other object
of similar type and also help in classifying/grouping objects.
• In java, abstraction is achieved by interfaces and abstract class, we can
achieve 100% abstraction using interfaces.
ENCAPSULATION
• It is defined as the wrapping up of data under a single unit
• It is the mechanism that binds together code and the data it manipulates
• It is a protective shield that prevents the data from being accessed by the code
outside this shield
• As in encapsulation, the data in a class is hidden from other classes, so it is
also known as data hiding.
• Encapsulation can be achieved by declaring all the variable in the class as
private and writing public methods in the class to set and get the values of
variables.
POLYMORPHISM
• The word polymorphism means having many forms
• In simple words, we can define polymorphism as the ability of a message to
be displayed in more than one form.
• Polymorphism allows us to perform a single action in different ways, in other
words, polymorphism allows you to define one interface and have multiple
implementations.
• The word “poly” means many and “morph” means forms, so it means many
forms
TYPES OF POLYMORPHISM
• In java polymorphism is mainly divided into two types.
• Compile-time polymorphism
• Run-time polymorphism
Compile-time polymorphism
• It is also known as static polymorphism.
• This type of polymorphism is a achieved by function overloading or
operator overloading
(java doesn’t support the operator overloading)
Method overloading: when there are multiple functions with the same name
but different parameters then these functions are said to be overloaded
Functions can be overloaded by change in the number of arguments
or/and a change in the type of arguments
Run-time polymorphism
• It is also known as Dynamic method dispatch
• It is a process in which a function call to the overridden method is resolved at
runtime
• This type of polymorphism is achieved by method overriding
Method overriding: on the other hand, occurs when a derived class has a
definition for one of the member functions of the base class, the base function is
said to be overridden.
INHERITANCE
• Inheritance in java is “ a mechanism in which one object acquire all the
properties and behaviours of a parent class object “
• It is an important part of oops
• The idea behind inheritance in java is that you can create new classes that are built
upon existing classes
• When you inherit from an existing class, you can reuse methods and fields of
parent class
• Inheritance represents the IS-A Relationship which is also known as a parent-child
relationship
USES OF INHERITANCE
• For method overriding
• For code reusability
TERMS USED IN INHERITANCE
• CLASS: A class is a group of objects which have common properties
it is a template or blueprint from which objects are created
• SUB CLASS/CHILD CLASS: Subclass is a class which inherits the other
class
it is also called derived class, extend class
• SUPER CLASS/ PARENT CLASS : Super class is the class from where a
subclass inherits the features.
it is also called a base class or a parent classs.
SYNTAX
Class Subclass_name extends Superclass_name
{
//Method and Fields
}
The extend keyword indicates that you are making a new class
that derives from an existing class.
TYPES OF INHERITANCE
• On the basis of class there can be three types of inheritance in java. Single,
Multilevel and Hierarchical.
• In java programming, multiple and hybrid inheritance is supported through
interface only.
• When one class inherits multiple classes it is known as multiple inheritance.
• SINGLE INHERITANCE: When a class inherits another class, it is known as
a single inheritance
• MULTILEVEL INHERITANCE: When there is a chain of inheritance it is
known as multilevel inheritance
• HIERARCHICAL INHERITANCE: When two or more classes inherits a
single class it is known as hierarchical inheritance
WHY MULTIPLE INHERITANCE IS NOT
SUPPORTED IN JAVA?
• To reduce the complexity and simplify the language, multiple inheritance is
not supported in java
• Consider, a scenario where A,B and C are three classes. The C class inherits A
and B classes
• If A and B classes have the same method and you call it from child class
object, there will be ambiguity to call the method of A or B class
• Since compile-time errors are better than runtime errors.
THANKING YOU
BY
HARIKUMAR M

More Related Content

PDF
‏‏‏‏‏‏oop lecture objectives will come.pdf
nabeehmohammedtaher
 
PPTX
OOPS – General Understanding in .NET
Sabith Byari
 
DOC
Questpond - Top 10 Interview Questions and Answers on OOPS
gdrealspace
 
PPTX
Introduction to oop and java fundamentals
AnsgarMary
 
PPTX
AkhileshD_Presentation_Core_Java_OOPs.pptx
Akhilesh740777
 
PDF
Lectupopplkmkmkkpompom-0ookoimmire 2.pdf
rtreduanur247
 
PPSX
Core java lessons
vivek shah
 
PPTX
arthimetic operator,classes,objects,instant
ssuser77162c
 
‏‏‏‏‏‏oop lecture objectives will come.pdf
nabeehmohammedtaher
 
OOPS – General Understanding in .NET
Sabith Byari
 
Questpond - Top 10 Interview Questions and Answers on OOPS
gdrealspace
 
Introduction to oop and java fundamentals
AnsgarMary
 
AkhileshD_Presentation_Core_Java_OOPs.pptx
Akhilesh740777
 
Lectupopplkmkmkkpompom-0ookoimmire 2.pdf
rtreduanur247
 
Core java lessons
vivek shah
 
arthimetic operator,classes,objects,instant
ssuser77162c
 

Similar to OOPS (Object Oriented Programming System) CONCEPTS (20)

PPTX
Introduction to OOP concepts
Ahmed Farag
 
PPTX
Polymorphism
Nuha Noor
 
PPTX
Object oriented programming
Saiful Islam Sany
 
PPTX
Unit II Inheritance ,Interface and Packages.pptx
pranalisonawane8600
 
PPTX
SKILLWISE - OOPS CONCEPT
Skillwise Group
 
PPTX
OOPS Characteristics (With Examples in PHP)
baabtra.com - No. 1 supplier of quality freshers
 
PPTX
java part 1 computer science.pptx
MUHAMMED MASHAHIL PUKKUNNUMMAL
 
PPTX
Ayan Das_25300121057.pptx
Ayan974999
 
PPTX
full defination of final opp.pptx
rayanbabur
 
PPTX
Module 4_Ch4 - Polymorphism and Inheritance.pptx
jhesorleylaid2
 
PPTX
Oopsinphp
NithyaNithyav
 
PDF
4th_class.pdf
RumiHossain5
 
PPTX
Presentation2.ppt java basic core ppt .
KeshavMotivation
 
PPTX
Inheritance in java.pptx_20241025_101324_0000.pptx.pptx
saurabhthege
 
PPTX
Java chapter 5
Abdii Rashid
 
PPT
Java_notes.ppt
tuyambazejeanclaude
 
PDF
Oops (inheritance&interface)
Muthukumaran Subramanian
 
PPTX
Introduction to oop
colleges
 
Introduction to OOP concepts
Ahmed Farag
 
Polymorphism
Nuha Noor
 
Object oriented programming
Saiful Islam Sany
 
Unit II Inheritance ,Interface and Packages.pptx
pranalisonawane8600
 
SKILLWISE - OOPS CONCEPT
Skillwise Group
 
OOPS Characteristics (With Examples in PHP)
baabtra.com - No. 1 supplier of quality freshers
 
java part 1 computer science.pptx
MUHAMMED MASHAHIL PUKKUNNUMMAL
 
Ayan Das_25300121057.pptx
Ayan974999
 
full defination of final opp.pptx
rayanbabur
 
Module 4_Ch4 - Polymorphism and Inheritance.pptx
jhesorleylaid2
 
Oopsinphp
NithyaNithyav
 
4th_class.pdf
RumiHossain5
 
Presentation2.ppt java basic core ppt .
KeshavMotivation
 
Inheritance in java.pptx_20241025_101324_0000.pptx.pptx
saurabhthege
 
Java chapter 5
Abdii Rashid
 
Java_notes.ppt
tuyambazejeanclaude
 
Oops (inheritance&interface)
Muthukumaran Subramanian
 
Introduction to oop
colleges
 
Ad

Recently uploaded (20)

PDF
Exploring AI Agents in Process Industries
amoreira6
 
PPTX
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
PDF
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
PDF
Bandai Playdia The Book - David Glotz
BluePanther6
 
PPT
Activate_Methodology_Summary presentatio
annapureddyn
 
PPTX
Why Use Open Source Reporting Tools for Business Intelligence.pptx
Varsha Nayak
 
PDF
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
PDF
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
PPTX
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
PDF
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
PPTX
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
PPTX
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
PFAS Reporting Requirements 2026 Are You Submission Ready Certivo.pptx
Certivo Inc
 
PDF
Microsoft Teams Essentials; The pricing and the versions_PDF.pdf
Q-Advise
 
PPTX
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
PPTX
Role Of Python In Programing Language.pptx
jaykoshti048
 
PPTX
oapresentation.pptx
mehatdhavalrajubhai
 
PDF
The Role of Automation and AI in EHS Management for Data Centers.pdf
TECH EHS Solution
 
PDF
Build Multi-agent using Agent Development Kit
FadyIbrahim23
 
PPTX
Presentation about variables and constant.pptx
safalsingh810
 
Exploring AI Agents in Process Industries
amoreira6
 
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
Bandai Playdia The Book - David Glotz
BluePanther6
 
Activate_Methodology_Summary presentatio
annapureddyn
 
Why Use Open Source Reporting Tools for Business Intelligence.pptx
Varsha Nayak
 
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PFAS Reporting Requirements 2026 Are You Submission Ready Certivo.pptx
Certivo Inc
 
Microsoft Teams Essentials; The pricing and the versions_PDF.pdf
Q-Advise
 
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
Role Of Python In Programing Language.pptx
jaykoshti048
 
oapresentation.pptx
mehatdhavalrajubhai
 
The Role of Automation and AI in EHS Management for Data Centers.pdf
TECH EHS Solution
 
Build Multi-agent using Agent Development Kit
FadyIbrahim23
 
Presentation about variables and constant.pptx
safalsingh810
 
Ad

OOPS (Object Oriented Programming System) CONCEPTS

  • 2. Introduction • Object oriented programming is a paradigm that provides many concepts such as inheritance, polymorphism, abstraction, encapsulation. • Simula is considered as the first object-oriented programming language • The main aim of oops is to bind together the data and the functions that operate on them so that no other part of the code can access this data except that functions.
  • 3. OOPS Concepts are • Class • Object • Method and method passing • Pillars of OOPs • Abstraction • Encapsulation • Inheritance • polymorphism
  • 4. CLASS • A class is a user defined blueprint or prototype from which objects are created. • It represents the set of properties or methods that are common to all objects of one type. • In general class declarations can include these components, in order • Modifier • Class name • Body
  • 5. OBJECT • Object is a basic unit of object oriented programming and represents the real life entities • A typical java program creates many objects, which as you know, interact by invoking methods. • An object consist of • State • Behaviour • Identity • method
  • 6. PILLARS OF OOP’s • ABSTRACTION • ENCAPSULATION • POLYMORPHISM • INHERITANCE
  • 7. ABSTRACTION • Data abstraction is the property by virtue of which only the essential details are displayed to the user. • Data abstraction may also be defined as the process of identifying only the required characteristics of an object ignoring the irrelevant details. • The properties and behaviours of an object differentiate it from other object of similar type and also help in classifying/grouping objects. • In java, abstraction is achieved by interfaces and abstract class, we can achieve 100% abstraction using interfaces.
  • 8. ENCAPSULATION • It is defined as the wrapping up of data under a single unit • It is the mechanism that binds together code and the data it manipulates • It is a protective shield that prevents the data from being accessed by the code outside this shield • As in encapsulation, the data in a class is hidden from other classes, so it is also known as data hiding. • Encapsulation can be achieved by declaring all the variable in the class as private and writing public methods in the class to set and get the values of variables.
  • 9. POLYMORPHISM • The word polymorphism means having many forms • In simple words, we can define polymorphism as the ability of a message to be displayed in more than one form. • Polymorphism allows us to perform a single action in different ways, in other words, polymorphism allows you to define one interface and have multiple implementations. • The word “poly” means many and “morph” means forms, so it means many forms
  • 10. TYPES OF POLYMORPHISM • In java polymorphism is mainly divided into two types. • Compile-time polymorphism • Run-time polymorphism
  • 11. Compile-time polymorphism • It is also known as static polymorphism. • This type of polymorphism is a achieved by function overloading or operator overloading (java doesn’t support the operator overloading) Method overloading: when there are multiple functions with the same name but different parameters then these functions are said to be overloaded Functions can be overloaded by change in the number of arguments or/and a change in the type of arguments
  • 12. Run-time polymorphism • It is also known as Dynamic method dispatch • It is a process in which a function call to the overridden method is resolved at runtime • This type of polymorphism is achieved by method overriding Method overriding: on the other hand, occurs when a derived class has a definition for one of the member functions of the base class, the base function is said to be overridden.
  • 13. INHERITANCE • Inheritance in java is “ a mechanism in which one object acquire all the properties and behaviours of a parent class object “ • It is an important part of oops • The idea behind inheritance in java is that you can create new classes that are built upon existing classes • When you inherit from an existing class, you can reuse methods and fields of parent class • Inheritance represents the IS-A Relationship which is also known as a parent-child relationship
  • 14. USES OF INHERITANCE • For method overriding • For code reusability
  • 15. TERMS USED IN INHERITANCE • CLASS: A class is a group of objects which have common properties it is a template or blueprint from which objects are created • SUB CLASS/CHILD CLASS: Subclass is a class which inherits the other class it is also called derived class, extend class • SUPER CLASS/ PARENT CLASS : Super class is the class from where a subclass inherits the features. it is also called a base class or a parent classs.
  • 16. SYNTAX Class Subclass_name extends Superclass_name { //Method and Fields } The extend keyword indicates that you are making a new class that derives from an existing class.
  • 17. TYPES OF INHERITANCE • On the basis of class there can be three types of inheritance in java. Single, Multilevel and Hierarchical. • In java programming, multiple and hybrid inheritance is supported through interface only. • When one class inherits multiple classes it is known as multiple inheritance.
  • 18. • SINGLE INHERITANCE: When a class inherits another class, it is known as a single inheritance • MULTILEVEL INHERITANCE: When there is a chain of inheritance it is known as multilevel inheritance • HIERARCHICAL INHERITANCE: When two or more classes inherits a single class it is known as hierarchical inheritance
  • 19. WHY MULTIPLE INHERITANCE IS NOT SUPPORTED IN JAVA? • To reduce the complexity and simplify the language, multiple inheritance is not supported in java • Consider, a scenario where A,B and C are three classes. The C class inherits A and B classes • If A and B classes have the same method and you call it from child class object, there will be ambiguity to call the method of A or B class • Since compile-time errors are better than runtime errors.