SlideShare a Scribd company logo
1 of 15
What is
Object-Oriented Programming
⚫ Any Idea ????
Definition
⚫ Object-oriented programming (OOP) is a
programming paradigm using "objects" – data
structures consisting of data fields and methods
together with their interactions – to design
applicationsand computerprograms. Programming
techniques may include features such as data
abstraction, encapsulation, messaging, modularity,
polymorphism, and inheritance
4 Pillars of OOPS
⚫ Abstraction
⚫ Polymorphism
⚫Inheritance
⚫ Encapsulation
Abstraction
⚫ Abstraction (from the Latin abs, meaning away from
and traction meaning to draw) is the process of taking
away or removing characteristics from something in
order toreduce it toa setof essential characteristics. In
object-oriented programming, abstraction is one of
three central principles (along with encapsulation and
inheritance). Through the process of abstraction, a
programmer hides all but the relevant data about an
object in order to reduce complexity and increase
efficiency. In the sameway thatabstractionomitted
Polymorphism
⚫ polymorphism refers toa programming language's
ability to process objects differently depending on
their data type or class. More specifically, it is the
ability to redefine methods for derived classes. For
example, given a base class shape, polymorphism
enables the programmer todefinedifferent area
methods for any number of derived classes, such as
circles, rectangles and triangles. No matterwhatshape
an object is, applying the area method to it will return
thecorrect results. Polymorphism isconsidered to be a
requirement of any true object-oriented programming
language (OOPL).
Inheritance
⚫ In object-oriented programming (OOP), inheritance
is a way to compartmentalize and reuse code by
creating collectionsof attributesand behaviorscalled
objects that can be based on previously created
objects. In classical inheritance where objects are
defined byclasses, classescan inheritotherclasses.
The new classes, known as subclasses (or derived
classes), inheritattributesand behavior (i.e. previously
coded algorithms) of the pre-existing classes, which
are referred to as superclasses, ancestor classes or base
classes. The inheritance relationships of classes gives
rise toa hierarchy
Encapsulation
⚫Encapsulation means as much as shielding. Each
object-oriented object has a shield around it. Objects
can't 'see' each other. They can exchange things
though, as if theyare interconnected through a hatch.
⚫shows theconceptof theencapsulation. Itseparates
the external aspects of an object from the internal
implementation details of the object, which are
hidden from other objects. The object encapsulates
both data and the logical procedures required to
manipulate thedata.
Encapsulation Example:
Classes
⚫ In object-oriented programming, a class is a construct
that is used as a blueprint to create instances of itself –
referred to as class instances, class objects, instance
objects or simply objects. A class defines constituent
members which enable these class instances to have
state and behavior. Data field members (member
variables or instance variables) enable a class object to
maintain state. Other kinds of members, especially
methods, enable a class object's behavior
Class In Java
⚫ Classesare the fundamental building blocksof a Java
program. Youcan define an Employeeclassas follows:
⚫class Employee {
int age;
double salary;
}
⚫Byconvention, class namescapitalize the initial of
each word.
⚫Forexample: Employee, Boss, DateUtility, PostOffice,
RegularRateCalculator.
Continued
⚫This typeof naming convention is knownas Pascal
naming convention.
⚫The otherconvention, thecamel naming convention,
capitalize the initial of each word, except the first
word.
⚫Method and field names use thecamel naming
convention
Object
⚫ An object doesn't exist until an instance of the class
has been created; the class is just a definition. When
theobject is physicallycreated, space for thatobject is
allocated in RAM. It is possible to have multiple
objectscreated from oneclass.
Access Control
In Javathere are 4 typesof access types
⚫1. Private .
⚫2. public .
⚫3. default (no type )
⚫4. protected .
◆ = CAN ACCESS ◇ = NO Access

More Related Content

Similar to OOP Lesson 2.pptx (20)

Oops concepts
Oops conceptsOops concepts
Oops concepts
 
JAVA-PPT'S.pptx
JAVA-PPT'S.pptxJAVA-PPT'S.pptx
JAVA-PPT'S.pptx
 
JAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptxJAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptx
 
Objects and Instances.ppt
Objects and Instances.pptObjects and Instances.ppt
Objects and Instances.ppt
 
PHP OOP Lecture - 01.pptx
PHP OOP Lecture - 01.pptxPHP OOP Lecture - 01.pptx
PHP OOP Lecture - 01.pptx
 
Oops slide
Oops slide Oops slide
Oops slide
 
Basic Concepts of Object Oriented Programming using C++
Basic Concepts of Object Oriented Programming using C++Basic Concepts of Object Oriented Programming using C++
Basic Concepts of Object Oriented Programming using C++
 
Encapsulation
EncapsulationEncapsulation
Encapsulation
 
Introduction to Object Oriented Programming.2.ppt
Introduction to Object Oriented Programming.2.pptIntroduction to Object Oriented Programming.2.ppt
Introduction to Object Oriented Programming.2.ppt
 
java part 1 computer science.pptx
java part 1 computer science.pptxjava part 1 computer science.pptx
java part 1 computer science.pptx
 
Principles of OOPs.pptx
Principles of OOPs.pptxPrinciples of OOPs.pptx
Principles of OOPs.pptx
 
Interview preparation for programming.pptx
Interview preparation for programming.pptxInterview preparation for programming.pptx
Interview preparation for programming.pptx
 
Ashish oot
Ashish ootAshish oot
Ashish oot
 
Benefits of encapsulation
Benefits of encapsulationBenefits of encapsulation
Benefits of encapsulation
 
Oops
OopsOops
Oops
 
CPP-Unit 1.pptx
CPP-Unit 1.pptxCPP-Unit 1.pptx
CPP-Unit 1.pptx
 
OOP
OOPOOP
OOP
 
OOSD1-unit1_1_16_09.pptx
OOSD1-unit1_1_16_09.pptxOOSD1-unit1_1_16_09.pptx
OOSD1-unit1_1_16_09.pptx
 
Principles of oop
Principles of oopPrinciples of oop
Principles of oop
 
Mca 504 dotnet_unit3
Mca 504 dotnet_unit3Mca 504 dotnet_unit3
Mca 504 dotnet_unit3
 

More from FranzLawrenzDeTorres1

More from FranzLawrenzDeTorres1 (20)

enterprisearchitectureppt-181203183218.pdf
enterprisearchitectureppt-181203183218.pdfenterprisearchitectureppt-181203183218.pdf
enterprisearchitectureppt-181203183218.pdf
 
finaldemo-ict10-180801142047.pdf
finaldemo-ict10-180801142047.pdffinaldemo-ict10-180801142047.pdf
finaldemo-ict10-180801142047.pdf
 
functionsandformulas-131221213835-phpapp01.pdf
functionsandformulas-131221213835-phpapp01.pdffunctionsandformulas-131221213835-phpapp01.pdf
functionsandformulas-131221213835-phpapp01.pdf
 
ER-and-EE-Lesson-1.pdf
ER-and-EE-Lesson-1.pdfER-and-EE-Lesson-1.pdf
ER-and-EE-Lesson-1.pdf
 
JDVP-Parents-Orientation.pptx
JDVP-Parents-Orientation.pptxJDVP-Parents-Orientation.pptx
JDVP-Parents-Orientation.pptx
 
Evolution of System.pptx
Evolution of System.pptxEvolution of System.pptx
Evolution of System.pptx
 
ICTConcepts.ppt
ICTConcepts.pptICTConcepts.ppt
ICTConcepts.ppt
 
animated-meeting-agenda-toolbox.pptx
animated-meeting-agenda-toolbox.pptxanimated-meeting-agenda-toolbox.pptx
animated-meeting-agenda-toolbox.pptx
 
SIA LESSON.pptx
SIA LESSON.pptxSIA LESSON.pptx
SIA LESSON.pptx
 
LESSON_8_1_NETWORK_CABLE.pptx
LESSON_8_1_NETWORK_CABLE.pptxLESSON_8_1_NETWORK_CABLE.pptx
LESSON_8_1_NETWORK_CABLE.pptx
 
English-10.pptx
English-10.pptxEnglish-10.pptx
English-10.pptx
 
personal-relationships11.ppsx
personal-relationships11.ppsxpersonal-relationships11.ppsx
personal-relationships11.ppsx
 
Ch02.ppt
Ch02.pptCh02.ppt
Ch02.ppt
 
chapter01-160621234231.pptx
chapter01-160621234231.pptxchapter01-160621234231.pptx
chapter01-160621234231.pptx
 
bahagingfeasib-180917140000.pptx
bahagingfeasib-180917140000.pptxbahagingfeasib-180917140000.pptx
bahagingfeasib-180917140000.pptx
 
THE CONDOM.pptx
THE CONDOM.pptxTHE CONDOM.pptx
THE CONDOM.pptx
 
INTRODUCTION TO MANAGEMENT SCIENCE.pptx
INTRODUCTION TO MANAGEMENT SCIENCE.pptxINTRODUCTION TO MANAGEMENT SCIENCE.pptx
INTRODUCTION TO MANAGEMENT SCIENCE.pptx
 
trisha pangit.pptx
trisha pangit.pptxtrisha pangit.pptx
trisha pangit.pptx
 
CSS.pptx
CSS.pptxCSS.pptx
CSS.pptx
 
bahagingpananalita-171106104815.pptx
bahagingpananalita-171106104815.pptxbahagingpananalita-171106104815.pptx
bahagingpananalita-171106104815.pptx
 

Recently uploaded

Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 

Recently uploaded (20)

Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 

OOP Lesson 2.pptx

  • 1.
  • 3. Definition ⚫ Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their interactions – to design applicationsand computerprograms. Programming techniques may include features such as data abstraction, encapsulation, messaging, modularity, polymorphism, and inheritance
  • 4. 4 Pillars of OOPS ⚫ Abstraction ⚫ Polymorphism ⚫Inheritance ⚫ Encapsulation
  • 5. Abstraction ⚫ Abstraction (from the Latin abs, meaning away from and traction meaning to draw) is the process of taking away or removing characteristics from something in order toreduce it toa setof essential characteristics. In object-oriented programming, abstraction is one of three central principles (along with encapsulation and inheritance). Through the process of abstraction, a programmer hides all but the relevant data about an object in order to reduce complexity and increase efficiency. In the sameway thatabstractionomitted
  • 6. Polymorphism ⚫ polymorphism refers toa programming language's ability to process objects differently depending on their data type or class. More specifically, it is the ability to redefine methods for derived classes. For example, given a base class shape, polymorphism enables the programmer todefinedifferent area methods for any number of derived classes, such as circles, rectangles and triangles. No matterwhatshape an object is, applying the area method to it will return thecorrect results. Polymorphism isconsidered to be a requirement of any true object-oriented programming language (OOPL).
  • 7. Inheritance ⚫ In object-oriented programming (OOP), inheritance is a way to compartmentalize and reuse code by creating collectionsof attributesand behaviorscalled objects that can be based on previously created objects. In classical inheritance where objects are defined byclasses, classescan inheritotherclasses. The new classes, known as subclasses (or derived classes), inheritattributesand behavior (i.e. previously coded algorithms) of the pre-existing classes, which are referred to as superclasses, ancestor classes or base classes. The inheritance relationships of classes gives rise toa hierarchy
  • 8. Encapsulation ⚫Encapsulation means as much as shielding. Each object-oriented object has a shield around it. Objects can't 'see' each other. They can exchange things though, as if theyare interconnected through a hatch. ⚫shows theconceptof theencapsulation. Itseparates the external aspects of an object from the internal implementation details of the object, which are hidden from other objects. The object encapsulates both data and the logical procedures required to manipulate thedata.
  • 10. Classes ⚫ In object-oriented programming, a class is a construct that is used as a blueprint to create instances of itself – referred to as class instances, class objects, instance objects or simply objects. A class defines constituent members which enable these class instances to have state and behavior. Data field members (member variables or instance variables) enable a class object to maintain state. Other kinds of members, especially methods, enable a class object's behavior
  • 11. Class In Java ⚫ Classesare the fundamental building blocksof a Java program. Youcan define an Employeeclassas follows: ⚫class Employee { int age; double salary; } ⚫Byconvention, class namescapitalize the initial of each word. ⚫Forexample: Employee, Boss, DateUtility, PostOffice, RegularRateCalculator.
  • 12. Continued ⚫This typeof naming convention is knownas Pascal naming convention. ⚫The otherconvention, thecamel naming convention, capitalize the initial of each word, except the first word. ⚫Method and field names use thecamel naming convention
  • 13. Object ⚫ An object doesn't exist until an instance of the class has been created; the class is just a definition. When theobject is physicallycreated, space for thatobject is allocated in RAM. It is possible to have multiple objectscreated from oneclass.
  • 14. Access Control In Javathere are 4 typesof access types ⚫1. Private . ⚫2. public . ⚫3. default (no type ) ⚫4. protected .
  • 15. ◆ = CAN ACCESS ◇ = NO Access