SlideShare a Scribd company logo
Introduction to Object Oriented
Programming
MD. Tanvir Hossain
Student, Dept of CSE
Daffodil International University
1
Object-Oriented Language
 In structured programming languages, methods define the
structure of the programs, they are basic building blocks
 Data has secondary role, it is just something that is passed
around.
 In object oriented languages, the data has the principal role
 Methods belong to the data, without the data, the method
does not have any meaning (Except static methods)
 Data and methods together make up the object.
 OOP tries to model the real world.
 What does the real world look like?
2
Objects everywhere...
Real world entities
3
Objects have state...
Red
Lying
Happy
Hooked
ill
Broken
4
Objects have behavior….
Hello,
I am John
Nice to
meet you
da da
…
Grrrrrrrr
Vroemm
5
World
 The world is
• a set of things
• interacting with each other.
 OOP is more natural to humans, but less natural to
computers
 Computers (usually) have a single thread of control, so
objects take turns
6
Describing the world
 Describe a particular person
• Ayman has long blond hair, green eyes, is 1.63m tall, weighs 56Kg
and studies computer engineering. Now lying down asleep.
• Mahmud studies electronics, has short black hair and brown eyes.
He is 180cm and 75 kilos. Now running to class!
 Notice how all have specific values of
• name, height, weight, eye colour, state, …
7
Advantages of OOP
 Simplicity: software objects model real world objects, so
the complexity is reduced and the program structure is
very clear;
 Modularity: each object forms a separate entity whose
internal workings are decoupled from other parts of the
system;
 Modifiability: it is easy to make minor changes in the data
representation or the procedures in an OO program.
Changes inside a class do not affect any other part of a
program, since the only public interface that the external
world has to a class is through the use of methods.
8
 Extensibility: adding new features or responding to
changing operating environments can be solved by
introducing a few new objects and modifying some existing
ones.
 Maintainability: objects can be maintained separately,
making locating and fixing problems easier.
 Re-usability: objects can be reused in different programs.
9
Advantages of OOP
Features of OOP
10
Classes
Data Abstraction
Encapsulation
Inheritance
Polymorphism
Information Hiding
Class and Object
11
 CLASS: Basic building blocks of OOP. Once a class has
been defined, we can create any number of objects
belonging to that class.
 OBJECT: Objects are instances or variables of the type
class. Objects has real existence and take up space in the
memory. When a program is executed , the objects interact
by sending messages to one another. Each object contain
data and code to manipulate the data.
Object Properties
 Identity
 State
 Behavior
myLamp
on
off
Object is an abstraction of a real world entity
12
Introduction to Objects
 An object represents something with which we can interact
in a program
 An object provides a collection of services that we can tell it
to perform for us
 The services are defined by methods in a class that defines
the object
 A class represents a concept, and an object represents the
embodiment of a class
 A class can be used to create multiple objects
13
Objects and Classes
Bank
Account
A class
(the concept)
John’s Bank Account
Balance: $5,257
An object
(the realization)
Bill’s Bank Account
Balance: $1,245,069
Mary’s Bank Account
Balance: $16,833
Multiple objects
from the same class
14
15
Abstraction
 Hiding the complexity of program is called Abstraction and only
essential features are represented. In short we can say that internal
working is hidden.
Abstraction A car consists of four wheels
an engine, accumulator
and brakes.
Encapsulation
 Combining data and functions into a single unit called class and the
process is known as Encapsulation.
 Data encapsulation is important feature of a class.
 Class contains both data and functions. Data is not accessible from the
outside world and only those function which are present in the class can
access the data.
16
 Refers to linking of function call with function definition is
called binding and when it is take place at run time called
dynamic binding.
17
Dynamic Binding
Message Passing
 The process by which one object interact with other object
is called message passing.
18
Inheritance
 It is the process by which object of one class acquire the
properties or features of objects of another class. The
concept of inheritance provide the idea of reusability means
we can add additional features to an existing class without
Modifying it. This is possible by driving a new class from
the existing one. The new class will have the combined
features of both the classes.
19
Inheritance : Example
20
Polymorphism
 The term polymorphism literally means "having many
forms"
 A polymorphic reference is a variable that can refer to
different types of objects at different points in time
 The method invoked through a polymorphic reference can
change from one invocation to the next
 All object references in Java are potentially polymorphic
21
Polymorphism : Example
22
Polymorphism
23
Ad

More Related Content

What's hot (20)

Introduction to oop
Introduction to oopIntroduction to oop
Introduction to oop
colleges
 
class and objects
class and objectsclass and objects
class and objects
Payel Guria
 
Oops ppt
Oops pptOops ppt
Oops ppt
abhayjuneja
 
Class and Objects in Java
Class and Objects in JavaClass and Objects in Java
Class and Objects in Java
Spotle.ai
 
Introduction to oops concepts
Introduction to oops conceptsIntroduction to oops concepts
Introduction to oops concepts
Nilesh Dalvi
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
Sujith Kumar
 
Encapsulation C++
Encapsulation C++Encapsulation C++
Encapsulation C++
Hashim Hashim
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
thinkphp
 
Static Data Members and Member Functions
Static Data Members and Member FunctionsStatic Data Members and Member Functions
Static Data Members and Member Functions
MOHIT AGARWAL
 
oops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaoops concept in java | object oriented programming in java
oops concept in java | object oriented programming in java
CPD INDIA
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
Michelle Anne Meralpis
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
Naz Abdalla
 
OOPS In JAVA.pptx
OOPS In JAVA.pptxOOPS In JAVA.pptx
OOPS In JAVA.pptx
Sachin33417
 
Oop Presentation
Oop PresentationOop Presentation
Oop Presentation
Ghaffar Khan
 
Basic concept of OOP's
Basic concept of OOP'sBasic concept of OOP's
Basic concept of OOP's
Prof. Dr. K. Adisesha
 
Conditional and control statement
Conditional and control statementConditional and control statement
Conditional and control statement
narmadhakin
 
Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)
MD Sulaiman
 
Control structure C++
Control structure C++Control structure C++
Control structure C++
Anil Kumar
 
Data Types & Variables in JAVA
Data Types & Variables in JAVAData Types & Variables in JAVA
Data Types & Variables in JAVA
Ankita Totala
 
Characteristics of oop
Characteristics of oopCharacteristics of oop
Characteristics of oop
Rasim Izhar Ali
 
Introduction to oop
Introduction to oopIntroduction to oop
Introduction to oop
colleges
 
class and objects
class and objectsclass and objects
class and objects
Payel Guria
 
Class and Objects in Java
Class and Objects in JavaClass and Objects in Java
Class and Objects in Java
Spotle.ai
 
Introduction to oops concepts
Introduction to oops conceptsIntroduction to oops concepts
Introduction to oops concepts
Nilesh Dalvi
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
Sujith Kumar
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
thinkphp
 
Static Data Members and Member Functions
Static Data Members and Member FunctionsStatic Data Members and Member Functions
Static Data Members and Member Functions
MOHIT AGARWAL
 
oops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaoops concept in java | object oriented programming in java
oops concept in java | object oriented programming in java
CPD INDIA
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
Michelle Anne Meralpis
 
OOPS In JAVA.pptx
OOPS In JAVA.pptxOOPS In JAVA.pptx
OOPS In JAVA.pptx
Sachin33417
 
Conditional and control statement
Conditional and control statementConditional and control statement
Conditional and control statement
narmadhakin
 
Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)
MD Sulaiman
 
Control structure C++
Control structure C++Control structure C++
Control structure C++
Anil Kumar
 
Data Types & Variables in JAVA
Data Types & Variables in JAVAData Types & Variables in JAVA
Data Types & Variables in JAVA
Ankita Totala
 

Similar to Introduction to Object Oriented Programming (20)

chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbxchapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
berihun18
 
Object oriented programming concept
Object oriented programming conceptObject oriented programming concept
Object oriented programming concept
Pina Parmar
 
Computer_Programming_Part_II_Segment_01.pdf
Computer_Programming_Part_II_Segment_01.pdfComputer_Programming_Part_II_Segment_01.pdf
Computer_Programming_Part_II_Segment_01.pdf
et243047
 
OOP
OOPOOP
OOP
Om Vikram Thapa
 
Basic Java Concept - Practical Oriented Methodologies
Basic Java Concept - Practical Oriented MethodologiesBasic Java Concept - Practical Oriented Methodologies
Basic Java Concept - Practical Oriented Methodologies
SakthiVinayagam5
 
1 intro
1 intro1 intro
1 intro
abha48
 
Unit 1 OOSE
Unit 1 OOSE Unit 1 OOSE
Unit 1 OOSE
ChhayaShelake
 
Oops slide
Oops slide Oops slide
Oops slide
Ashok Sharma
 
CS3391 -OOP -UNIT – I NOTES FINAL.pdf
CS3391 -OOP -UNIT – I  NOTES FINAL.pdfCS3391 -OOP -UNIT – I  NOTES FINAL.pdf
CS3391 -OOP -UNIT – I NOTES FINAL.pdf
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
 
What is clear to you about OOP in Java- and what concepts are still cl.docx
What is clear to you about OOP in Java- and what concepts are still cl.docxWhat is clear to you about OOP in Java- and what concepts are still cl.docx
What is clear to you about OOP in Java- and what concepts are still cl.docx
dorisc7
 
JAVA - Oops Concept.pptx
JAVA - Oops Concept.pptxJAVA - Oops Concept.pptx
JAVA - Oops Concept.pptx
ayankamila005
 
Introduction of OOPs
Introduction of OOPsIntroduction of OOPs
Introduction of OOPs
Integral University
 
L1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdfL1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdf
BhanuJatinSingh
 
M.c.a. (sem iv)- java programming
M.c.a. (sem   iv)- java programmingM.c.a. (sem   iv)- java programming
M.c.a. (sem iv)- java programming
Praveen Chowdary
 
Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1 Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1
Sakthi Durai
 
Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...
Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...
Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...
Sakthi Durai
 
OBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptx
OBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptxOBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptx
OBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptx
Maharshi Dayanand University Rohtak
 
Oops concepts
Oops conceptsOops concepts
Oops concepts
ACCESS Health Digital
 
object oriented programming(syed munib ali 11b-023-bs)
object oriented programming(syed munib ali 11b-023-bs)object oriented programming(syed munib ali 11b-023-bs)
object oriented programming(syed munib ali 11b-023-bs)
munibali55
 
Principles of OOPs.pptx
Principles of OOPs.pptxPrinciples of OOPs.pptx
Principles of OOPs.pptx
LakshyaChauhan21
 
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbxchapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
berihun18
 
Object oriented programming concept
Object oriented programming conceptObject oriented programming concept
Object oriented programming concept
Pina Parmar
 
Computer_Programming_Part_II_Segment_01.pdf
Computer_Programming_Part_II_Segment_01.pdfComputer_Programming_Part_II_Segment_01.pdf
Computer_Programming_Part_II_Segment_01.pdf
et243047
 
Basic Java Concept - Practical Oriented Methodologies
Basic Java Concept - Practical Oriented MethodologiesBasic Java Concept - Practical Oriented Methodologies
Basic Java Concept - Practical Oriented Methodologies
SakthiVinayagam5
 
1 intro
1 intro1 intro
1 intro
abha48
 
What is clear to you about OOP in Java- and what concepts are still cl.docx
What is clear to you about OOP in Java- and what concepts are still cl.docxWhat is clear to you about OOP in Java- and what concepts are still cl.docx
What is clear to you about OOP in Java- and what concepts are still cl.docx
dorisc7
 
JAVA - Oops Concept.pptx
JAVA - Oops Concept.pptxJAVA - Oops Concept.pptx
JAVA - Oops Concept.pptx
ayankamila005
 
L1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdfL1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdf
BhanuJatinSingh
 
M.c.a. (sem iv)- java programming
M.c.a. (sem   iv)- java programmingM.c.a. (sem   iv)- java programming
M.c.a. (sem iv)- java programming
Praveen Chowdary
 
Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1 Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1
Sakthi Durai
 
Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...
Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...
Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...
Sakthi Durai
 
object oriented programming(syed munib ali 11b-023-bs)
object oriented programming(syed munib ali 11b-023-bs)object oriented programming(syed munib ali 11b-023-bs)
object oriented programming(syed munib ali 11b-023-bs)
munibali55
 
Ad

More from Md. Tanvir Hossain (14)

Automated train
Automated trainAutomated train
Automated train
Md. Tanvir Hossain
 
Captcha
CaptchaCaptcha
Captcha
Md. Tanvir Hossain
 
Adjusting the accounts
Adjusting the accountsAdjusting the accounts
Adjusting the accounts
Md. Tanvir Hossain
 
Segmentation
SegmentationSegmentation
Segmentation
Md. Tanvir Hossain
 
Linux file system
Linux file systemLinux file system
Linux file system
Md. Tanvir Hossain
 
Normalization
NormalizationNormalization
Normalization
Md. Tanvir Hossain
 
Application of interpolation in CSE
Application of interpolation in CSEApplication of interpolation in CSE
Application of interpolation in CSE
Md. Tanvir Hossain
 
Internet(Internetwork)
Internet(Internetwork)Internet(Internetwork)
Internet(Internetwork)
Md. Tanvir Hossain
 
Basic Biocomputing
Basic BiocomputingBasic Biocomputing
Basic Biocomputing
Md. Tanvir Hossain
 
Intel core i3 processor
Intel core i3 processorIntel core i3 processor
Intel core i3 processor
Md. Tanvir Hossain
 
Satellite communication and it's future
Satellite communication and it's futureSatellite communication and it's future
Satellite communication and it's future
Md. Tanvir Hossain
 
Introduction to JAVA
Introduction to JAVAIntroduction to JAVA
Introduction to JAVA
Md. Tanvir Hossain
 
Java interface
Java interfaceJava interface
Java interface
Md. Tanvir Hossain
 
Java exception handling
Java exception handlingJava exception handling
Java exception handling
Md. Tanvir Hossain
 
Ad

Recently uploaded (20)

How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales moduleHow To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
Celine George
 
How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18
Celine George
 
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFAMEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
Dr. Nasir Mustafa
 
Pope Leo XIV, the first Pope from North America.pptx
Pope Leo XIV, the first Pope from North America.pptxPope Leo XIV, the first Pope from North America.pptx
Pope Leo XIV, the first Pope from North America.pptx
Martin M Flynn
 
What is the Philosophy of Statistics? (and how I was drawn to it)
What is the Philosophy of Statistics? (and how I was drawn to it)What is the Philosophy of Statistics? (and how I was drawn to it)
What is the Philosophy of Statistics? (and how I was drawn to it)
jemille6
 
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
Dr. Nasir Mustafa
 
E-Filing_of_Income_Tax.pptx and concept of form 26AS
E-Filing_of_Income_Tax.pptx and concept of form 26ASE-Filing_of_Income_Tax.pptx and concept of form 26AS
E-Filing_of_Income_Tax.pptx and concept of form 26AS
Abinash Palangdar
 
antiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidenceantiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidence
PrachiSontakke5
 
Rock Art As a Source of Ancient Indian History
Rock Art As a Source of Ancient Indian HistoryRock Art As a Source of Ancient Indian History
Rock Art As a Source of Ancient Indian History
Virag Sontakke
 
UPMVLE migration to ARAL. A step- by- step guide
UPMVLE migration to ARAL. A step- by- step guideUPMVLE migration to ARAL. A step- by- step guide
UPMVLE migration to ARAL. A step- by- step guide
abmerca
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and GuestsLDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDM Mia eStudios
 
How to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo SlidesHow to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo Slides
Celine George
 
Search Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo SlidesSearch Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo Slides
Celine George
 
*"Sensing the World: Insect Sensory Systems"*
*"Sensing the World: Insect Sensory Systems"**"Sensing the World: Insect Sensory Systems"*
*"Sensing the World: Insect Sensory Systems"*
Arshad Shaikh
 
spinal cord disorders (Myelopathies and radiculoapthies)
spinal cord disorders (Myelopathies and radiculoapthies)spinal cord disorders (Myelopathies and radiculoapthies)
spinal cord disorders (Myelopathies and radiculoapthies)
Mohamed Rizk Khodair
 
The History of Kashmir Karkota Dynasty NEP.pptx
The History of Kashmir Karkota Dynasty NEP.pptxThe History of Kashmir Karkota Dynasty NEP.pptx
The History of Kashmir Karkota Dynasty NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
Module 1: Foundations of Research
Module 1: Foundations of ResearchModule 1: Foundations of Research
Module 1: Foundations of Research
drroxannekemp
 
How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18
Celine George
 
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptxANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
Mayuri Chavan
 
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales moduleHow To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
Celine George
 
How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18
Celine George
 
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFAMEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
Dr. Nasir Mustafa
 
Pope Leo XIV, the first Pope from North America.pptx
Pope Leo XIV, the first Pope from North America.pptxPope Leo XIV, the first Pope from North America.pptx
Pope Leo XIV, the first Pope from North America.pptx
Martin M Flynn
 
What is the Philosophy of Statistics? (and how I was drawn to it)
What is the Philosophy of Statistics? (and how I was drawn to it)What is the Philosophy of Statistics? (and how I was drawn to it)
What is the Philosophy of Statistics? (and how I was drawn to it)
jemille6
 
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
Dr. Nasir Mustafa
 
E-Filing_of_Income_Tax.pptx and concept of form 26AS
E-Filing_of_Income_Tax.pptx and concept of form 26ASE-Filing_of_Income_Tax.pptx and concept of form 26AS
E-Filing_of_Income_Tax.pptx and concept of form 26AS
Abinash Palangdar
 
antiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidenceantiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidence
PrachiSontakke5
 
Rock Art As a Source of Ancient Indian History
Rock Art As a Source of Ancient Indian HistoryRock Art As a Source of Ancient Indian History
Rock Art As a Source of Ancient Indian History
Virag Sontakke
 
UPMVLE migration to ARAL. A step- by- step guide
UPMVLE migration to ARAL. A step- by- step guideUPMVLE migration to ARAL. A step- by- step guide
UPMVLE migration to ARAL. A step- by- step guide
abmerca
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and GuestsLDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDM Mia eStudios
 
How to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo SlidesHow to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo Slides
Celine George
 
Search Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo SlidesSearch Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo Slides
Celine George
 
*"Sensing the World: Insect Sensory Systems"*
*"Sensing the World: Insect Sensory Systems"**"Sensing the World: Insect Sensory Systems"*
*"Sensing the World: Insect Sensory Systems"*
Arshad Shaikh
 
spinal cord disorders (Myelopathies and radiculoapthies)
spinal cord disorders (Myelopathies and radiculoapthies)spinal cord disorders (Myelopathies and radiculoapthies)
spinal cord disorders (Myelopathies and radiculoapthies)
Mohamed Rizk Khodair
 
Module 1: Foundations of Research
Module 1: Foundations of ResearchModule 1: Foundations of Research
Module 1: Foundations of Research
drroxannekemp
 
How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18
Celine George
 
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptxANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
Mayuri Chavan
 

Introduction to Object Oriented Programming

  • 1. Introduction to Object Oriented Programming MD. Tanvir Hossain Student, Dept of CSE Daffodil International University 1
  • 2. Object-Oriented Language  In structured programming languages, methods define the structure of the programs, they are basic building blocks  Data has secondary role, it is just something that is passed around.  In object oriented languages, the data has the principal role  Methods belong to the data, without the data, the method does not have any meaning (Except static methods)  Data and methods together make up the object.  OOP tries to model the real world.  What does the real world look like? 2
  • 5. Objects have behavior…. Hello, I am John Nice to meet you da da … Grrrrrrrr Vroemm 5
  • 6. World  The world is • a set of things • interacting with each other.  OOP is more natural to humans, but less natural to computers  Computers (usually) have a single thread of control, so objects take turns 6
  • 7. Describing the world  Describe a particular person • Ayman has long blond hair, green eyes, is 1.63m tall, weighs 56Kg and studies computer engineering. Now lying down asleep. • Mahmud studies electronics, has short black hair and brown eyes. He is 180cm and 75 kilos. Now running to class!  Notice how all have specific values of • name, height, weight, eye colour, state, … 7
  • 8. Advantages of OOP  Simplicity: software objects model real world objects, so the complexity is reduced and the program structure is very clear;  Modularity: each object forms a separate entity whose internal workings are decoupled from other parts of the system;  Modifiability: it is easy to make minor changes in the data representation or the procedures in an OO program. Changes inside a class do not affect any other part of a program, since the only public interface that the external world has to a class is through the use of methods. 8
  • 9.  Extensibility: adding new features or responding to changing operating environments can be solved by introducing a few new objects and modifying some existing ones.  Maintainability: objects can be maintained separately, making locating and fixing problems easier.  Re-usability: objects can be reused in different programs. 9 Advantages of OOP
  • 10. Features of OOP 10 Classes Data Abstraction Encapsulation Inheritance Polymorphism Information Hiding
  • 11. Class and Object 11  CLASS: Basic building blocks of OOP. Once a class has been defined, we can create any number of objects belonging to that class.  OBJECT: Objects are instances or variables of the type class. Objects has real existence and take up space in the memory. When a program is executed , the objects interact by sending messages to one another. Each object contain data and code to manipulate the data.
  • 12. Object Properties  Identity  State  Behavior myLamp on off Object is an abstraction of a real world entity 12
  • 13. Introduction to Objects  An object represents something with which we can interact in a program  An object provides a collection of services that we can tell it to perform for us  The services are defined by methods in a class that defines the object  A class represents a concept, and an object represents the embodiment of a class  A class can be used to create multiple objects 13
  • 14. Objects and Classes Bank Account A class (the concept) John’s Bank Account Balance: $5,257 An object (the realization) Bill’s Bank Account Balance: $1,245,069 Mary’s Bank Account Balance: $16,833 Multiple objects from the same class 14
  • 15. 15 Abstraction  Hiding the complexity of program is called Abstraction and only essential features are represented. In short we can say that internal working is hidden. Abstraction A car consists of four wheels an engine, accumulator and brakes.
  • 16. Encapsulation  Combining data and functions into a single unit called class and the process is known as Encapsulation.  Data encapsulation is important feature of a class.  Class contains both data and functions. Data is not accessible from the outside world and only those function which are present in the class can access the data. 16
  • 17.  Refers to linking of function call with function definition is called binding and when it is take place at run time called dynamic binding. 17 Dynamic Binding
  • 18. Message Passing  The process by which one object interact with other object is called message passing. 18
  • 19. Inheritance  It is the process by which object of one class acquire the properties or features of objects of another class. The concept of inheritance provide the idea of reusability means we can add additional features to an existing class without Modifying it. This is possible by driving a new class from the existing one. The new class will have the combined features of both the classes. 19
  • 21. Polymorphism  The term polymorphism literally means "having many forms"  A polymorphic reference is a variable that can refer to different types of objects at different points in time  The method invoked through a polymorphic reference can change from one invocation to the next  All object references in Java are potentially polymorphic 21
  翻译: