SlideShare a Scribd company logo
8
Most read
9
Most read
11
Most read
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

More Related Content

PPT
Basic concepts of object oriented programming
Sachin Sharma
 
PPT
Oops ppt
abhayjuneja
 
PPT
Object-oriented concepts
BG Java EE Course
 
PPTX
Stream classes in C++
Shyam Gupta
 
PPTX
Classes, objects in JAVA
Abhilash Nair
 
PDF
Oops concepts || Object Oriented Programming Concepts in Java
Madishetty Prathibha
 
PPTX
Classes objects in java
Madishetty Prathibha
 
PPTX
Object Oriented Programing JAVA presentaion
Pritom Chaki
 
Basic concepts of object oriented programming
Sachin Sharma
 
Oops ppt
abhayjuneja
 
Object-oriented concepts
BG Java EE Course
 
Stream classes in C++
Shyam Gupta
 
Classes, objects in JAVA
Abhilash Nair
 
Oops concepts || Object Oriented Programming Concepts in Java
Madishetty Prathibha
 
Classes objects in java
Madishetty Prathibha
 
Object Oriented Programing JAVA presentaion
Pritom Chaki
 

What's hot (20)

PPTX
Data types in c++
Venkata.Manish Reddy
 
PPT
Structure of C++ - R.D.Sivakumar
Sivakumar R D .
 
PPTX
Need of object oriented programming
Amar Jukuntla
 
PDF
Constructor and Destructor
Kamal Acharya
 
PPTX
Structures in c language
tanmaymodi4
 
PPTX
Introduction to oop
colleges
 
PPTX
object oriented Programming ppt
Nitesh Dubey
 
PPT
Introduction to oop
Kumar
 
PPTX
Constructor and Destructor in c++
aleenaguen
 
PPTX
Oop c++class(final).ppt
Alok Kumar
 
PDF
The Object Model
yndaravind
 
PPT
Class and object in C++
rprajat007
 
PPT
Abstract class
Tony Nguyen
 
PPTX
[OOP - Lec 08] Encapsulation (Information Hiding)
Muhammad Hammad Waseem
 
PPTX
Python-Encapsulation.pptx
Karudaiyar Ganapathy
 
PPTX
Abstract class and Interface
Haris Bin Zahid
 
PPTX
Procedural programming
Ankit92Chitnavis
 
PPTX
concept of oops
prince sharma
 
PDF
Object Oriented Programming Lecture Notes
FellowBuddy.com
 
PPT
PHP - Introduction to Object Oriented Programming with PHP
Vibrant Technologies & Computers
 
Data types in c++
Venkata.Manish Reddy
 
Structure of C++ - R.D.Sivakumar
Sivakumar R D .
 
Need of object oriented programming
Amar Jukuntla
 
Constructor and Destructor
Kamal Acharya
 
Structures in c language
tanmaymodi4
 
Introduction to oop
colleges
 
object oriented Programming ppt
Nitesh Dubey
 
Introduction to oop
Kumar
 
Constructor and Destructor in c++
aleenaguen
 
Oop c++class(final).ppt
Alok Kumar
 
The Object Model
yndaravind
 
Class and object in C++
rprajat007
 
Abstract class
Tony Nguyen
 
[OOP - Lec 08] Encapsulation (Information Hiding)
Muhammad Hammad Waseem
 
Python-Encapsulation.pptx
Karudaiyar Ganapathy
 
Abstract class and Interface
Haris Bin Zahid
 
Procedural programming
Ankit92Chitnavis
 
concept of oops
prince sharma
 
Object Oriented Programming Lecture Notes
FellowBuddy.com
 
PHP - Introduction to Object Oriented Programming with PHP
Vibrant Technologies & Computers
 
Ad

Similar to Introduction to Object Oriented Programming (20)

PDF
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
ApurvaLaddha
 
PPTX
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
berihun18
 
PDF
babsatu-140703233001-phpapp666666601.pdf
kashafishfaq21
 
PPTX
Bab satu
Aida Ramlan II
 
PDF
L1-Introduction to OOPs concepts.pdf
BhanuJatinSingh
 
PPTX
JAVA PROGRAMMINGD
Niyitegekabilly
 
PPTX
the Concept of Object-Oriented Programming
Aida Ramlan II
 
PPTX
Birasa 1
Niyitegekabilly
 
PPTX
JAVA PROGRAMMING
Niyitegekabilly
 
PPT
Basic Java Concept - Practical Oriented Methodologies
SakthiVinayagam5
 
PPTX
1 intro
abha48
 
PPTX
oop.pptx
KabitaParajuli3
 
PPTX
POP vs OOP Introduction
Hashni T
 
PDF
1unit-120324103142-phpapp02.pdf
SahajShrimal1
 
PPTX
Intro to object oriented programming.pptx
RafiaZafar19
 
PPT
Basic concept of OOP's
Prof. Dr. K. Adisesha
 
PDF
Computer_Programming_Part_II_Segment_01.pdf
et243047
 
PPTX
Unit - I Intro. to OOP Concepts and Control Structure -OOP and CG (2024 Patte...
babasahebgaikwad8
 
PPTX
General oop concept
Avneesh Yadav
 
PDF
OOPS_Unit_1
Shipra Swati
 
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
ApurvaLaddha
 
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
berihun18
 
babsatu-140703233001-phpapp666666601.pdf
kashafishfaq21
 
Bab satu
Aida Ramlan II
 
L1-Introduction to OOPs concepts.pdf
BhanuJatinSingh
 
JAVA PROGRAMMINGD
Niyitegekabilly
 
the Concept of Object-Oriented Programming
Aida Ramlan II
 
Birasa 1
Niyitegekabilly
 
JAVA PROGRAMMING
Niyitegekabilly
 
Basic Java Concept - Practical Oriented Methodologies
SakthiVinayagam5
 
1 intro
abha48
 
oop.pptx
KabitaParajuli3
 
POP vs OOP Introduction
Hashni T
 
1unit-120324103142-phpapp02.pdf
SahajShrimal1
 
Intro to object oriented programming.pptx
RafiaZafar19
 
Basic concept of OOP's
Prof. Dr. K. Adisesha
 
Computer_Programming_Part_II_Segment_01.pdf
et243047
 
Unit - I Intro. to OOP Concepts and Control Structure -OOP and CG (2024 Patte...
babasahebgaikwad8
 
General oop concept
Avneesh Yadav
 
OOPS_Unit_1
Shipra Swati
 
Ad

More from Md. Tanvir Hossain (14)

PPTX
Automated train
Md. Tanvir Hossain
 
PPTX
Captcha
Md. Tanvir Hossain
 
PPTX
Adjusting the accounts
Md. Tanvir Hossain
 
PPTX
Segmentation
Md. Tanvir Hossain
 
PPTX
Linux file system
Md. Tanvir Hossain
 
PPTX
Normalization
Md. Tanvir Hossain
 
PPTX
Application of interpolation in CSE
Md. Tanvir Hossain
 
PPTX
Internet(Internetwork)
Md. Tanvir Hossain
 
PPTX
Basic Biocomputing
Md. Tanvir Hossain
 
PPTX
Intel core i3 processor
Md. Tanvir Hossain
 
PPTX
Satellite communication and it's future
Md. Tanvir Hossain
 
PPTX
Introduction to JAVA
Md. Tanvir Hossain
 
PPTX
Java interface
Md. Tanvir Hossain
 
PPTX
Java exception handling
Md. Tanvir Hossain
 
Automated train
Md. Tanvir Hossain
 
Adjusting the accounts
Md. Tanvir Hossain
 
Segmentation
Md. Tanvir Hossain
 
Linux file system
Md. Tanvir Hossain
 
Normalization
Md. Tanvir Hossain
 
Application of interpolation in CSE
Md. Tanvir Hossain
 
Internet(Internetwork)
Md. Tanvir Hossain
 
Basic Biocomputing
Md. Tanvir Hossain
 
Intel core i3 processor
Md. Tanvir Hossain
 
Satellite communication and it's future
Md. Tanvir Hossain
 
Introduction to JAVA
Md. Tanvir Hossain
 
Java interface
Md. Tanvir Hossain
 
Java exception handling
Md. Tanvir Hossain
 

Recently uploaded (20)

PDF
Sunset Boulevard Student Revision Booklet
jpinnuck
 
PDF
1.Natural-Resources-and-Their-Use.ppt pdf /8th class social science Exploring...
Sandeep Swamy
 
PPTX
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PPTX
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
PPTX
Understanding operators in c language.pptx
auteharshil95
 
DOCX
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
PDF
PG-BPSDMP 2 TAHUN 2025PG-BPSDMP 2 TAHUN 2025.pdf
AshifaRamadhani
 
PPTX
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
RAKESH SAJJAN
 
PDF
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
PDF
Arihant Class 10 All in One Maths full pdf
sajal kumar
 
PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
PDF
Wings of Fire Book by Dr. A.P.J Abdul Kalam Full PDF
hetalvaishnav93
 
PPTX
Strengthening open access through collaboration: building connections with OP...
Jisc
 
PPTX
Skill Development Program For Physiotherapy Students by SRY.pptx
Prof.Dr.Y.SHANTHOSHRAJA MPT Orthopedic., MSc Microbiology
 
PPTX
Care of patients with elImination deviation.pptx
AneetaSharma15
 
PDF
Exploring-Forces 5.pdf/8th science curiosity/by sandeep swamy notes/ppt
Sandeep Swamy
 
PDF
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PPTX
IMMUNIZATION PROGRAMME pptx
AneetaSharma15
 
Sunset Boulevard Student Revision Booklet
jpinnuck
 
1.Natural-Resources-and-Their-Use.ppt pdf /8th class social science Exploring...
Sandeep Swamy
 
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
Understanding operators in c language.pptx
auteharshil95
 
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
PG-BPSDMP 2 TAHUN 2025PG-BPSDMP 2 TAHUN 2025.pdf
AshifaRamadhani
 
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
RAKESH SAJJAN
 
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
Arihant Class 10 All in One Maths full pdf
sajal kumar
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
Wings of Fire Book by Dr. A.P.J Abdul Kalam Full PDF
hetalvaishnav93
 
Strengthening open access through collaboration: building connections with OP...
Jisc
 
Skill Development Program For Physiotherapy Students by SRY.pptx
Prof.Dr.Y.SHANTHOSHRAJA MPT Orthopedic., MSc Microbiology
 
Care of patients with elImination deviation.pptx
AneetaSharma15
 
Exploring-Forces 5.pdf/8th science curiosity/by sandeep swamy notes/ppt
Sandeep Swamy
 
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
IMMUNIZATION PROGRAMME pptx
AneetaSharma15
 

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