SlideShare a Scribd company logo
1
INTRODUCTION TO OOP
Objective:
•Know the difference between functional programmin
and OOP
• Know basic terminology in OOP
• Know the importance of OOP
• Know four design principles of OOP
• Know OOP programming languages
Programming Paradigm
A programming paradigm is a style, or
“way,” of programming
Types of Programming
Paradigm
Imperative: Programming with an explicit
sequence of commands that update state.
Declarative: Programming by specifying
the result you want, not how to get it.
Object-Oriented: Programming by
defining objects that send messages to
each other. Objects have their own
internal (encapsulated) state and public
interfaces.
Types of Programming
Paradigm…
Object orientation can be:
Class-based: Objects get state and behavior
based on membership in a class.
Prototype-based: Objects get behavior from
a prototype object.
Structured: Programming with clean,
goto-free, nested control structures.
Procedural: Imperative programming
with procedure calls.
Types of Programming
Paradigm..
Event-Driven: Programming with emitters and
listeners of asynchronous actions.
Flow-Driven: Programming processes
communicating with each other over
predefined channels.
Functional (Applicative): Programming with
function calls that avoid any global state.
Function-Level (Combinator): Programming
with no variables at all.
Types of Programming
Paradigm..
Logic (Rule-based): Programming by
specifying a set of facts and rules. An
engine infers the answers to questions.
Constraint: Programming by specifying
a set of constraints. An engine finds the
values that meet the constraints.
Aspect-Oriented: Programming cross-
cutting concerns applied transparently.
7
STRUCTURED vs. OO PROGRAMMING
STRUCTURED PROGRAMMING:
MAIN PROGRAM
FUNCTION 3
FUNCTION 2
GLOBAL DATA
FUNCTION 5
FUNCTION 4
FUNCTION 1
8
Structured Programming
Using function
Function & program is divided into modules
Every module has its own data and function
which can be called by other modules.
9
OBJECT ORIENTED PROGRAMMING
Object 1
Object 2
Data
Function
Data
Function
Object 3
Data
Function
10
OBJECT ORIENTED PROGRAMMING
•Objects have both data and methods
• Objects of the same class have the same data
elements and methods
• Objects send and receive messages to invoke
actions
Key idea in object-oriented:
The real world can be accurately described as a collection of
objects that interact.
11
Basic terminology
Basic terminology
•object
- usually a person, place or thing (a noun)
•method
- an action performed by an object (a verb)
•attribute
- description of objects in a class
•class
- a category of similar objects (such as
automobiles)
- does not hold any values of the object’s attributes
12
Example for attributes and methods
Attributes:
manufacturer’s
name
model name
year made
color
number of doors
size of engine
etc.
Methods:
Define data items
(specify
manufacturer’s name,
model, year, etc.)
Change a data item
(color, engine, etc.)
Display data items
Calculate cost
etc.
13
Why OOP?
• Save development time (and cost) by reusing
code
–once an object class is created it can be used
in other applications
• Easier debugging
–classes can be tested independently
–reused objects have already been tested
14
Design Principles of OOP
Four main design principles of Object-
Oriented Programming(OOP):
• Encapsulation
• Abstraction
• Polymorphism
• Inheritance
15
Encapsulation
•Also known as data hiding
•Only object’s methods can modify information
in the object.
Analogy:
• ATM machine can only update accounts of one
person or object only.
16
Abstraction
Focus only on the important facts about the
problem at hand
to design, produce, and describe so that it can be
easily used without knowing the details of how it
works.
Analogy:
When you drive a car, you don’t have to know how
the gasoline and air are mixed and ignited.
Instead you only have to know how to use the
controls.
Draw map
17
Polymorphism
•the same word or phrase can mean different
things in different contexts
Analogy:
•In English, bank can mean side of a river or a
place to put money
•move -
18
Function Overloading
The operation of one function depends on
the argument passed to it.
Example: Fly(), Fly(low), Fly(150)
19
Inheritance
• Inheritance—a way of organizing classes
• Term comes from inheritance of traits like eye
color, hair color, and so on.
• Classes with properties in common can be
grouped so that their common properties are
only defined once.
• Superclass – inherit its attributes & methods to
the subclass(es).
• Subclass – can inherit all its superclass
attributes & methods besides having its own
unique attributes & methods.
20
An Inheritance Hierarchy
Vehicle
Automobile Motorcycle Bus
Sedan Sports Car School Bus
Luxury Bus
What properties does each vehicle inherit from the types
of vehicles above it in the diagram?
Superclass
Subclasses
21
Object-Oriented Programming Languages
 Pure OO Languages
Smalltalk, Eiffel, Actor, Java
 Hybrid OO Languages
C++, Objective-C, Object-Pascal

More Related Content

PPT
OOP programming
anhdbh
 
PPT
Intro tooop
Parameshwar Maddela
 
PPT
IntroToOOP.ppt
ssuser2d043c
 
PPT
IntroToOOP.ppt
kthejeswari
 
PPT
IntroToOOP.ppt
kthejeswari
 
PPT
IntroT.ppt
WrushabhShirsat3
 
PPT
IntroToOOP.ppt
kavitamittal18
 
PPT
IntroductionToObjectOrientedProgrammingLanguage
jaganchary1
 
OOP programming
anhdbh
 
Intro tooop
Parameshwar Maddela
 
IntroToOOP.ppt
ssuser2d043c
 
IntroToOOP.ppt
kthejeswari
 
IntroToOOP.ppt
kthejeswari
 
IntroT.ppt
WrushabhShirsat3
 
IntroToOOP.ppt
kavitamittal18
 
IntroductionToObjectOrientedProgrammingLanguage
jaganchary1
 

Similar to Introduction.ppt JAVA SCRIPT PROGRAMMING AND (20)

PDF
Introduction to object oriented programming
Abzetdin Adamov
 
PPTX
Introduction to Object Oriented Programming
Moutaz Haddara
 
PPTX
General oop concept
Avneesh Yadav
 
PPT
M01_OO_Intro.ppt
RojaPogul1
 
PPTX
1 intro
abha48
 
PPTX
Object Oriented Programming Part 2 of Unit 1
VigneshkumarPonnusam1
 
PPT
Chapter 02 The Object Model_Software E.ppt
AhammadUllah3
 
PPTX
Fundamentals of OOP (Object Oriented Programming)
MD Sulaiman
 
PDF
80410172053.pdf
WrushabhShirsat3
 
PPTX
Ooad unit – 1 introduction
Babeetha Muruganantham
 
PPT
oodb.ppt
ISHAAGARWAL75
 
PDF
Object Modelling Technique " ooad "
AchrafJbr
 
PDF
Handout on Object orienetd Analysis and Design
SAFAD ISMAIL
 
PPSX
Object Oriented Programming Overview for the PeopleSoft Developer
Lee Greffin
 
PPT
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
akashsachu221
 
PPTX
Computer Science ACW Intro to OOP L7.pptx
EdmondLabule2
 
PPTX
Object Oriented Programming
Muhammad Jahanzaib
 
PPTX
UNIT - 1 Java Fundamentals, Basics of java
VasimTamboli11
 
Introduction to object oriented programming
Abzetdin Adamov
 
Introduction to Object Oriented Programming
Moutaz Haddara
 
General oop concept
Avneesh Yadav
 
M01_OO_Intro.ppt
RojaPogul1
 
1 intro
abha48
 
Object Oriented Programming Part 2 of Unit 1
VigneshkumarPonnusam1
 
Chapter 02 The Object Model_Software E.ppt
AhammadUllah3
 
Fundamentals of OOP (Object Oriented Programming)
MD Sulaiman
 
80410172053.pdf
WrushabhShirsat3
 
Ooad unit – 1 introduction
Babeetha Muruganantham
 
oodb.ppt
ISHAAGARWAL75
 
Object Modelling Technique " ooad "
AchrafJbr
 
Handout on Object orienetd Analysis and Design
SAFAD ISMAIL
 
Object Oriented Programming Overview for the PeopleSoft Developer
Lee Greffin
 
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
akashsachu221
 
Computer Science ACW Intro to OOP L7.pptx
EdmondLabule2
 
Object Oriented Programming
Muhammad Jahanzaib
 
UNIT - 1 Java Fundamentals, Basics of java
VasimTamboli11
 
Ad

Recently uploaded (20)

PPT
Leadership essentials to build your carrier
ahmedhasan769002
 
PDF
HR Jobs in Jaipur: 2025 Trends, Banking Careers & Smart Hiring Tools
ravisalarite
 
PDF
PowerPoint Presentation -- Khai Y -- 7891fd01905c67ba9330323ac4f6626e -- Anna...
AmmaraAdeel1
 
PDF
Copy of HKISO FINAL ROUND Session 1 & 2 - S3 and SS.pdf
nothisispatrickduhh
 
PPTX
Public_Health_Informghiufdrgatics_PPT.pptx
venkiprince758
 
DOCX
Digital Marketing In Chandigarh Excellence Technology
chetann0777
 
PPTX
Women Entrepreneurship in India - A Brief Study
AshwinGanatra1
 
PDF
Applying Lean Six Sigma in Pre-Sales & Pre-Development: Setting the Stage for...
alekhyamandadi1
 
PDF
Invincible season 2 storyboard revisions seq2 by Mark G
MarkGalez
 
PPTX
MASTERING COMMUNICATION SKILLS.pptxgdee33w
akramm8009
 
PPTX
AMB Trainingt for School Teachers.pptx h
vidushirathiji
 
PDF
Invincible season 2 storyboard revisions seq3 by Mark G
MarkGalez
 
PPTX
Monitoring and Developing non wood Forest product.pptx
wehabrebiawel1
 
PPTX
FIND ODD SHAPE OUT for placement activity.pptx
YESIMSMART
 
PPTX
The actual field of Real_Estate_CRM_Strategy.pptx
SanjivaMudada
 
PPTX
Untitled presentation voice baed jounral
husnafaisal055
 
PPTX
Top Bank Jobs in Jaipur Roles, Salaries & Smart Hiring Trends in 2025.pptx
ravisalarite
 
PPT
T4C0400nbvnmbnb njb ncbs001A0011PPTE.ppt
shubhdps2004
 
PPTX
First Homeroom Meeting in Dahlia SY2025-2026
katrinacalado
 
PDF
Invincible Season 2 Storyboard Revisions by Mark G
MarkGalez
 
Leadership essentials to build your carrier
ahmedhasan769002
 
HR Jobs in Jaipur: 2025 Trends, Banking Careers & Smart Hiring Tools
ravisalarite
 
PowerPoint Presentation -- Khai Y -- 7891fd01905c67ba9330323ac4f6626e -- Anna...
AmmaraAdeel1
 
Copy of HKISO FINAL ROUND Session 1 & 2 - S3 and SS.pdf
nothisispatrickduhh
 
Public_Health_Informghiufdrgatics_PPT.pptx
venkiprince758
 
Digital Marketing In Chandigarh Excellence Technology
chetann0777
 
Women Entrepreneurship in India - A Brief Study
AshwinGanatra1
 
Applying Lean Six Sigma in Pre-Sales & Pre-Development: Setting the Stage for...
alekhyamandadi1
 
Invincible season 2 storyboard revisions seq2 by Mark G
MarkGalez
 
MASTERING COMMUNICATION SKILLS.pptxgdee33w
akramm8009
 
AMB Trainingt for School Teachers.pptx h
vidushirathiji
 
Invincible season 2 storyboard revisions seq3 by Mark G
MarkGalez
 
Monitoring and Developing non wood Forest product.pptx
wehabrebiawel1
 
FIND ODD SHAPE OUT for placement activity.pptx
YESIMSMART
 
The actual field of Real_Estate_CRM_Strategy.pptx
SanjivaMudada
 
Untitled presentation voice baed jounral
husnafaisal055
 
Top Bank Jobs in Jaipur Roles, Salaries & Smart Hiring Trends in 2025.pptx
ravisalarite
 
T4C0400nbvnmbnb njb ncbs001A0011PPTE.ppt
shubhdps2004
 
First Homeroom Meeting in Dahlia SY2025-2026
katrinacalado
 
Invincible Season 2 Storyboard Revisions by Mark G
MarkGalez
 
Ad

Introduction.ppt JAVA SCRIPT PROGRAMMING AND

  • 1. 1 INTRODUCTION TO OOP Objective: •Know the difference between functional programmin and OOP • Know basic terminology in OOP • Know the importance of OOP • Know four design principles of OOP • Know OOP programming languages
  • 2. Programming Paradigm A programming paradigm is a style, or “way,” of programming
  • 3. Types of Programming Paradigm Imperative: Programming with an explicit sequence of commands that update state. Declarative: Programming by specifying the result you want, not how to get it. Object-Oriented: Programming by defining objects that send messages to each other. Objects have their own internal (encapsulated) state and public interfaces.
  • 4. Types of Programming Paradigm… Object orientation can be: Class-based: Objects get state and behavior based on membership in a class. Prototype-based: Objects get behavior from a prototype object. Structured: Programming with clean, goto-free, nested control structures. Procedural: Imperative programming with procedure calls.
  • 5. Types of Programming Paradigm.. Event-Driven: Programming with emitters and listeners of asynchronous actions. Flow-Driven: Programming processes communicating with each other over predefined channels. Functional (Applicative): Programming with function calls that avoid any global state. Function-Level (Combinator): Programming with no variables at all.
  • 6. Types of Programming Paradigm.. Logic (Rule-based): Programming by specifying a set of facts and rules. An engine infers the answers to questions. Constraint: Programming by specifying a set of constraints. An engine finds the values that meet the constraints. Aspect-Oriented: Programming cross- cutting concerns applied transparently.
  • 7. 7 STRUCTURED vs. OO PROGRAMMING STRUCTURED PROGRAMMING: MAIN PROGRAM FUNCTION 3 FUNCTION 2 GLOBAL DATA FUNCTION 5 FUNCTION 4 FUNCTION 1
  • 8. 8 Structured Programming Using function Function & program is divided into modules Every module has its own data and function which can be called by other modules.
  • 9. 9 OBJECT ORIENTED PROGRAMMING Object 1 Object 2 Data Function Data Function Object 3 Data Function
  • 10. 10 OBJECT ORIENTED PROGRAMMING •Objects have both data and methods • Objects of the same class have the same data elements and methods • Objects send and receive messages to invoke actions Key idea in object-oriented: The real world can be accurately described as a collection of objects that interact.
  • 11. 11 Basic terminology Basic terminology •object - usually a person, place or thing (a noun) •method - an action performed by an object (a verb) •attribute - description of objects in a class •class - a category of similar objects (such as automobiles) - does not hold any values of the object’s attributes
  • 12. 12 Example for attributes and methods Attributes: manufacturer’s name model name year made color number of doors size of engine etc. Methods: Define data items (specify manufacturer’s name, model, year, etc.) Change a data item (color, engine, etc.) Display data items Calculate cost etc.
  • 13. 13 Why OOP? • Save development time (and cost) by reusing code –once an object class is created it can be used in other applications • Easier debugging –classes can be tested independently –reused objects have already been tested
  • 14. 14 Design Principles of OOP Four main design principles of Object- Oriented Programming(OOP): • Encapsulation • Abstraction • Polymorphism • Inheritance
  • 15. 15 Encapsulation •Also known as data hiding •Only object’s methods can modify information in the object. Analogy: • ATM machine can only update accounts of one person or object only.
  • 16. 16 Abstraction Focus only on the important facts about the problem at hand to design, produce, and describe so that it can be easily used without knowing the details of how it works. Analogy: When you drive a car, you don’t have to know how the gasoline and air are mixed and ignited. Instead you only have to know how to use the controls. Draw map
  • 17. 17 Polymorphism •the same word or phrase can mean different things in different contexts Analogy: •In English, bank can mean side of a river or a place to put money •move -
  • 18. 18 Function Overloading The operation of one function depends on the argument passed to it. Example: Fly(), Fly(low), Fly(150)
  • 19. 19 Inheritance • Inheritance—a way of organizing classes • Term comes from inheritance of traits like eye color, hair color, and so on. • Classes with properties in common can be grouped so that their common properties are only defined once. • Superclass – inherit its attributes & methods to the subclass(es). • Subclass – can inherit all its superclass attributes & methods besides having its own unique attributes & methods.
  • 20. 20 An Inheritance Hierarchy Vehicle Automobile Motorcycle Bus Sedan Sports Car School Bus Luxury Bus What properties does each vehicle inherit from the types of vehicles above it in the diagram? Superclass Subclasses
  • 21. 21 Object-Oriented Programming Languages  Pure OO Languages Smalltalk, Eiffel, Actor, Java  Hybrid OO Languages C++, Objective-C, Object-Pascal