SlideShare a Scribd company logo
1 of 36
Download to read offline
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 1
Haresh Jaiswal
Rising Technologies, Jalna.
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 2
Object Oriented Concepts
 Objects
 Classes
 Data Abstraction
 Encapsulation
 Polymorphism
 Inheritance
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 3
Object
 Objects are the basic run-time entities in an OOP
environment.
 They may represent:
 a person,
 a place,
 a bank account or
 any item that the program has to handle.
 Objects are simply variables of type class. Or In pure OOP
terms an object is an instance of a user defined data type
class.
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 4
Object
 As the name object-oriented implies, objects are key to
understand object-oriented technology.
 You can look around you & can see many examples of
real-world objects:
 your cell phone,
 your dog,
 your television set,
 your car.
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 5
Object
 All these real-world objects share two characteristics:
 they all have state
 and they all have behaviour
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 6
Real-World Objects
 A Real World Object : Dog
 have state like
1. Name,
2. Colour,
3. Breed
 have behaviours like
1. Barking,
2. Eating
State Value
Name Tommy
Colour Brown
Breed Labrador
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 7
Real-World Objects
 A Real World Object : Car
 have state like
1. Brand,
2. Make,
3. Engine CC
 have behaviours like
1. Accelerate,
2. Brake,
3. Change Gear State Value
Brand Maruti
Make Swift
Engine CC 1248 CC
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 8
Programmatic Objects
 Software/Programmatic objects are modelled after real-
world objects in that they too have state and behaviour.
 A Programmatic object : Box
 have state like
 Height,
 Width,
 Depth
 have behaviours like
 getDimensions()
 putVolume()
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 9
Programmatic Objects
 A Programmatic object : Bank Account
 have state like
 Acct No,
 Acct Holder’s Name,
 Current Balance
 have behaviours like
 Deposit(),
 Withdrawal()
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 10
Programmatic Objects
 A Programmatic object : Employee
 have state like
 Employee ID,
 Employee Name,
 Basic Salary
 have behaviours like
 getData(),
 putSalary()
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 11
Programmatic Objects
 Everything that the software object knows (its state) and
can do (its behaviour) is expressed by the variables and
methods within that object.
 A software/programmatic object maintains:
 its state in variables
 implements its behaviour with methods/functions.
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 12
Programming Objects
Object : Student
State (Data)
RollNo
Name
M1, M2, M3
Behaviour (Functions)
getData()
putResult()
Object : Employee
State (Data)
EmpNo
Name
Basic, Ta, Da, Gross
Object : Box
State (Data)
Height
Width
Depth
Behaviour (Functions)
getDimensions()
putVolume()
Behaviour (Functions)
getData()
putSalary()
Each object contains Data and Code to manipulate that Data
Or
An object is a bundle of variables and related methods/functions.
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 13
Example of Objects
 A software object that modelled your real-world box
would have variables that indicates the box’s current
state:
 Height : 4
 Width : 7
 Depth : 6
 The software object box would also have
methods/functions to:
 getDimensions() : to take dimensions as input from user
 putVolume() : to calculate and print volume of box
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 14
Example of Objects
 A software object that modelled your real-world car
would have variables that indicates the car’s current
state:
 speed : 10 mph,
 pedal cadence : 90 rpm,
 current gear is : 5th.
 The software object car would also have
methods/functions to:
 brake,
 change the pedal cadence,
 change gears.
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 15
Example of Objects
 You can think of an object as a fancy variable;
 it stores data and you can “make requests” to that object,
asking it to perform operations on itself.
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 16
Example of Objects
 You can represent real-world objects using software
objects. You can represent:
 real-world dog as software object in an animation program.
 real-world car as a software object within a game program.
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 17
Class
 Classes are actually special kinds of templates from which
you can create objects.
 Definition : Class is a way of binding Data and its
associated Functions/Methods together.
 When you define a class, you define a blueprint for an
abstract data type.
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 18
Class
 A class is created to characterise your programmatic
object.
 Everything a programmatic object knows (its state) and
can do (its behaviour) is characterised using variables and
methods defined inside the class.
 A class is a logical abstract but an object has a physical
existence in the memory.
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 19
Abstract Data Type
 Defining a Class means creating an abstract data type in
any object oriented programming language.
 A data type can be called abstract, if it do not reveal its
internal implementation to the user of that type.
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 20
Abstract Data Type
 There are 2 parts to each ADT:
 The external (public) part, which consists of:
 the conceptual picture (user's view of how the object looks like)
 the conceptual operations (what the user can do to the ADT)
 The internal (private) part, which consists of:
 the representation (how the structure is actually stored)
 the implementation of the operations (the actual code)
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 21
Abstraction
 In simple words, abstraction is ‘Hiding implementation
details behind the interface’
 When abstraction is created our concern is limited to
what it can do rather how it is doing it.
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 22
Abstraction
 When we drive a car we often need to change the gears
of the vehicle but we are not concerned about the inner
details of the vehicle engine. What matters to us is that
we must shift a gear, that's it. This is abstraction
 Show only those details which matters to the user.
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 23
Abstraction
 What exactly is Hiding implementation details behind the
interface?
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 24
Abstraction
class box
{
private:
float h, w, d;
public:
void getDimensions()
{
cout << “Enter Height, Width & Depth : “;
cin >> h >> w >> d;
}
void putVolume()
{
cout << “Volume : “ << (h * w * d);
}
};
Class Definition, the internal details/implementation of ADT
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 25
Abstraction
Object : Box
State(Data)
Height
Width
Depth
Behaviour/Functions
getDimensions()
putVolume()
An Object of Class Box, user has knowledge about its external
interface only.
Actual implementation,
User has no knowledge
about this part of object.
External Interface to use
this object,
User has knowledge only
about this part of the object.
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 26
Encapsulation
 The wrapping of code and data into a single unit is called
as encapsulation.
 Encapsulation binds together data and code to
manipulate that data, it keeps both them safe from
outside interference and mis-use.
 Encapsulation is a protective container that prevents code
and data from being accessed by other code defined
outside the container.
 Creating a Class is the way to implement Encapsulation.
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 27
Encapsulation
 Object encapsulates data and operations in one unit
 An object is a bundle of data; who know how to do things
to itself.
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 28
Polymorphism
 In object-oriented programming polymorphism means
the ability to appear in many forms.
 polymorphism refers to a programming language's ability
to process objects differently depending on their data
type or class.
 It is the provision of a single interface to entities of
different types.
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 29
Polymorphism
 An operation may perform different behaviors in different
instances and the behavior depends upon the type of
data used in the operation.
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 30
Polymorphism
 Consider the operation of adding two integer values using
+ operator, then the operation will generate a sum, but if
operands in the operation is of string type then the
operation would produce a third string by concatenation.
5 + 2 => 7 // integer operands
“Rising” + “Tech” => “Rising Tech” // string operands
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 31
Polymorphism
 So this process of making an operator to perform
different behaviors in different instances is known as
“operator overloading”
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 32
Polymorphism
Class : Shape
---------------------------
Draw()
Object : Circle
---------------------
Draw(circle)
Object : Box
---------------------
Draw(box)
Object : Triangle
---------------------
Draw(triangle)
This figure illustrates that a single function name can be used to handle
different number and different type of arguments.
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 33
Polymorphism
 Using a single function name to perform different types of
tasks is known as ‘Function Overloading’
 This is something similar to a particular word having
several different meanings depending on the context.
I Saw a Saw with a Saw Sawing a Saw...
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 34
Virtual Functions
 Virtual functions is the ability to redefine methods in
derived classes.
 For example, given a base class shape, polymorphism
enables the programmer to define different area
methods for any number of derived classes, such as
circles, rectangles and triangles.
 No matter what shape an object is, applying
the area method to it will return the correct results.
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 35
Polymorphism
Polymorphism
Compile Time
Function
Overloading
Operator
Overloading
Runtime
Virtual
Functions
Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 36
Polymorphism
 Polymorphism plays an important role in allowing objects
to have different internal structures but to share the
same external interface.

More Related Content

What's hot

Union in c language
Union  in c languageUnion  in c language
Union in c languagetanmaymodi4
 
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorialsMayank Jain
 
Virtual Functions | Polymorphism | OOP
Virtual Functions | Polymorphism | OOPVirtual Functions | Polymorphism | OOP
Virtual Functions | Polymorphism | OOPshubham ghimire
 
This keyword in java
This keyword in javaThis keyword in java
This keyword in javaHitesh Kumar
 
UML and Case study
UML and Case study UML and Case study
UML and Case study Mihika-QA
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to ScalaRahul Jain
 
The Evolution of Java
The Evolution of JavaThe Evolution of Java
The Evolution of JavaFu Cheng
 
Object Oriented programming - Introduction
Object Oriented programming - IntroductionObject Oriented programming - Introduction
Object Oriented programming - IntroductionMadishetty Prathibha
 
Object Oriented Programming in Python
Object Oriented Programming in PythonObject Oriented Programming in Python
Object Oriented Programming in PythonSujith Kumar
 
Final keyword in java
Final keyword in javaFinal keyword in java
Final keyword in javaHitesh Kumar
 
INLINE FUNCTION IN C++
INLINE FUNCTION IN C++INLINE FUNCTION IN C++
INLINE FUNCTION IN C++Vraj Patel
 
Let us understand design pattern
Let us understand design patternLet us understand design pattern
Let us understand design patternMindfire Solutions
 
Multiple inheritance possible in Java
Multiple inheritance possible in JavaMultiple inheritance possible in Java
Multiple inheritance possible in JavaKurapati Vishwak
 

What's hot (20)

Union in c language
Union  in c languageUnion  in c language
Union in c language
 
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorials
 
Virtual Functions | Polymorphism | OOP
Virtual Functions | Polymorphism | OOPVirtual Functions | Polymorphism | OOP
Virtual Functions | Polymorphism | OOP
 
This keyword in java
This keyword in javaThis keyword in java
This keyword in java
 
UML and Case study
UML and Case study UML and Case study
UML and Case study
 
Threads in JAVA
Threads in JAVAThreads in JAVA
Threads in JAVA
 
Introduction to OOP in Python
Introduction to OOP in PythonIntroduction to OOP in Python
Introduction to OOP in Python
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
The Evolution of Java
The Evolution of JavaThe Evolution of Java
The Evolution of Java
 
Object Oriented programming - Introduction
Object Oriented programming - IntroductionObject Oriented programming - Introduction
Object Oriented programming - Introduction
 
OOP java
OOP javaOOP java
OOP java
 
Class diagrams
Class diagramsClass diagrams
Class diagrams
 
Object Oriented Programming in Python
Object Oriented Programming in PythonObject Oriented Programming in Python
Object Oriented Programming in Python
 
Final keyword in java
Final keyword in javaFinal keyword in java
Final keyword in java
 
Compiler Design Unit 4
Compiler Design Unit 4Compiler Design Unit 4
Compiler Design Unit 4
 
C# Delegates
C# DelegatesC# Delegates
C# Delegates
 
INLINE FUNCTION IN C++
INLINE FUNCTION IN C++INLINE FUNCTION IN C++
INLINE FUNCTION IN C++
 
Java Basic Oops Concept
Java Basic Oops ConceptJava Basic Oops Concept
Java Basic Oops Concept
 
Let us understand design pattern
Let us understand design patternLet us understand design pattern
Let us understand design pattern
 
Multiple inheritance possible in Java
Multiple inheritance possible in JavaMultiple inheritance possible in Java
Multiple inheritance possible in Java
 

Viewers also liked

01. introduction to C++
01. introduction to C++01. introduction to C++
01. introduction to C++Haresh Jaiswal
 
04. constructor & destructor
04. constructor & destructor04. constructor & destructor
04. constructor & destructorHaresh Jaiswal
 
Parameterized Constructor
Parameterized ConstructorParameterized Constructor
Parameterized ConstructorMukesh Pathak
 
SystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features SummarySystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features SummaryAmal Khailtash
 
constructor & destructor in cpp
constructor & destructor in cppconstructor & destructor in cpp
constructor & destructor in cppgourav kottawar
 
Object Orinted Programing(OOP) concepts \
Object Orinted Programing(OOP) concepts \Object Orinted Programing(OOP) concepts \
Object Orinted Programing(OOP) concepts \Pritom Chaki
 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programmingSachin Sharma
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingMoutaz Haddara
 
Constructor and destructor in c++
Constructor and destructor in c++Constructor and destructor in c++
Constructor and destructor in c++Learn By Watch
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Conceptsthinkphp
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheLeslie Samuel
 

Viewers also liked (20)

01. introduction to C++
01. introduction to C++01. introduction to C++
01. introduction to C++
 
General oops concepts
General oops conceptsGeneral oops concepts
General oops concepts
 
04. constructor & destructor
04. constructor & destructor04. constructor & destructor
04. constructor & destructor
 
Oops
OopsOops
Oops
 
Parameterized Constructor
Parameterized ConstructorParameterized Constructor
Parameterized Constructor
 
OOP Basic
OOP BasicOOP Basic
OOP Basic
 
SystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features SummarySystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features Summary
 
Constructor and destructor
Constructor  and  destructor Constructor  and  destructor
Constructor and destructor
 
Oop basic overview
Oop basic overviewOop basic overview
Oop basic overview
 
Oop concepts
Oop conceptsOop concepts
Oop concepts
 
constructor & destructor in cpp
constructor & destructor in cppconstructor & destructor in cpp
constructor & destructor in cpp
 
General OOP concept [by-Digvijay]
General OOP concept [by-Digvijay]General OOP concept [by-Digvijay]
General OOP concept [by-Digvijay]
 
Object Orinted Programing(OOP) concepts \
Object Orinted Programing(OOP) concepts \Object Orinted Programing(OOP) concepts \
Object Orinted Programing(OOP) concepts \
 
Constructors & destructors
Constructors & destructorsConstructors & destructors
Constructors & destructors
 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programming
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented Programming
 
Constructor and destructor in c++
Constructor and destructor in c++Constructor and destructor in c++
Constructor and destructor in c++
 
Constructor ppt
Constructor pptConstructor ppt
Constructor ppt
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
 

Similar to 03. oop concepts

Object oriented design-UNIT V
Object oriented design-UNIT VObject oriented design-UNIT V
Object oriented design-UNIT VAzhar Shaik
 
Easy ORM-ness with Objectify-Appengine - Indicthreads cloud computing confere...
Easy ORM-ness with Objectify-Appengine - Indicthreads cloud computing confere...Easy ORM-ness with Objectify-Appengine - Indicthreads cloud computing confere...
Easy ORM-ness with Objectify-Appengine - Indicthreads cloud computing confere...IndicThreads
 
Chapter 1- Introduction.ppt
Chapter 1- Introduction.pptChapter 1- Introduction.ppt
Chapter 1- Introduction.pptTigistTilahun1
 
The Evolution Of Eclipse 1. 1 )
The Evolution Of Eclipse 1. 1 )The Evolution Of Eclipse 1. 1 )
The Evolution Of Eclipse 1. 1 )Patty Buckley
 
Cis 555 Week 4 Assignment 2 Automated Teller Machine (Atm)...
Cis 555 Week 4 Assignment 2 Automated Teller Machine (Atm)...Cis 555 Week 4 Assignment 2 Automated Teller Machine (Atm)...
Cis 555 Week 4 Assignment 2 Automated Teller Machine (Atm)...Karen Thompson
 
iPhone Workshop Mobile Monday Ahmedabad
iPhone Workshop Mobile Monday AhmedabadiPhone Workshop Mobile Monday Ahmedabad
iPhone Workshop Mobile Monday Ahmedabadmomoahmedabad
 
MongoDB World 2018: Building Intelligent Apps with MongoDB & Google Cloud
MongoDB World 2018: Building Intelligent Apps with MongoDB & Google CloudMongoDB World 2018: Building Intelligent Apps with MongoDB & Google Cloud
MongoDB World 2018: Building Intelligent Apps with MongoDB & Google CloudMongoDB
 
WELCOME TO AI PROJECT shidhant mittaal.pptx
WELCOME TO AI PROJECT shidhant mittaal.pptxWELCOME TO AI PROJECT shidhant mittaal.pptx
WELCOME TO AI PROJECT shidhant mittaal.pptx9D38SHIDHANTMITTAL
 
Un Microsystem Company Analysis Essay
Un Microsystem Company Analysis EssayUn Microsystem Company Analysis Essay
Un Microsystem Company Analysis EssayRikki Wright
 
The Accounting Integration Platform Permits
The Accounting Integration Platform PermitsThe Accounting Integration Platform Permits
The Accounting Integration Platform PermitsJennifer Letterman
 
Agile Testing Days 2017 Intoducing AgileBI Sustainably - Excercises
Agile Testing Days 2017 Intoducing AgileBI Sustainably - ExcercisesAgile Testing Days 2017 Intoducing AgileBI Sustainably - Excercises
Agile Testing Days 2017 Intoducing AgileBI Sustainably - ExcercisesRaphael Branger
 
Car Showroom management System in c++
Car Showroom management System in c++Car Showroom management System in c++
Car Showroom management System in c++PUBLIVE
 
OOP_POP
OOP_POPOOP_POP
OOP_POPC A
 
CSc investigatory project
CSc investigatory projectCSc investigatory project
CSc investigatory projectDIVYANSHU KUMAR
 
C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]Rome468
 
Agile Data Science 2.0
Agile Data Science 2.0Agile Data Science 2.0
Agile Data Science 2.0Russell Jurney
 

Similar to 03. oop concepts (20)

Object oriented design-UNIT V
Object oriented design-UNIT VObject oriented design-UNIT V
Object oriented design-UNIT V
 
Easy ORM-ness with Objectify-Appengine - Indicthreads cloud computing confere...
Easy ORM-ness with Objectify-Appengine - Indicthreads cloud computing confere...Easy ORM-ness with Objectify-Appengine - Indicthreads cloud computing confere...
Easy ORM-ness with Objectify-Appengine - Indicthreads cloud computing confere...
 
Chapter 1- Introduction.ppt
Chapter 1- Introduction.pptChapter 1- Introduction.ppt
Chapter 1- Introduction.ppt
 
The Evolution Of Eclipse 1. 1 )
The Evolution Of Eclipse 1. 1 )The Evolution Of Eclipse 1. 1 )
The Evolution Of Eclipse 1. 1 )
 
Cis 555 Week 4 Assignment 2 Automated Teller Machine (Atm)...
Cis 555 Week 4 Assignment 2 Automated Teller Machine (Atm)...Cis 555 Week 4 Assignment 2 Automated Teller Machine (Atm)...
Cis 555 Week 4 Assignment 2 Automated Teller Machine (Atm)...
 
Sdlc
SdlcSdlc
Sdlc
 
Sdlc
SdlcSdlc
Sdlc
 
Object Oriented Programing and JAVA
Object Oriented Programing and JAVAObject Oriented Programing and JAVA
Object Oriented Programing and JAVA
 
iPhone Workshop Mobile Monday Ahmedabad
iPhone Workshop Mobile Monday AhmedabadiPhone Workshop Mobile Monday Ahmedabad
iPhone Workshop Mobile Monday Ahmedabad
 
MongoDB World 2018: Building Intelligent Apps with MongoDB & Google Cloud
MongoDB World 2018: Building Intelligent Apps with MongoDB & Google CloudMongoDB World 2018: Building Intelligent Apps with MongoDB & Google Cloud
MongoDB World 2018: Building Intelligent Apps with MongoDB & Google Cloud
 
WELCOME TO AI PROJECT shidhant mittaal.pptx
WELCOME TO AI PROJECT shidhant mittaal.pptxWELCOME TO AI PROJECT shidhant mittaal.pptx
WELCOME TO AI PROJECT shidhant mittaal.pptx
 
Un Microsystem Company Analysis Essay
Un Microsystem Company Analysis EssayUn Microsystem Company Analysis Essay
Un Microsystem Company Analysis Essay
 
The Accounting Integration Platform Permits
The Accounting Integration Platform PermitsThe Accounting Integration Platform Permits
The Accounting Integration Platform Permits
 
Agile Testing Days 2017 Intoducing AgileBI Sustainably - Excercises
Agile Testing Days 2017 Intoducing AgileBI Sustainably - ExcercisesAgile Testing Days 2017 Intoducing AgileBI Sustainably - Excercises
Agile Testing Days 2017 Intoducing AgileBI Sustainably - Excercises
 
Car Showroom management System in c++
Car Showroom management System in c++Car Showroom management System in c++
Car Showroom management System in c++
 
OOP_POP
OOP_POPOOP_POP
OOP_POP
 
C++
C++C++
C++
 
CSc investigatory project
CSc investigatory projectCSc investigatory project
CSc investigatory project
 
C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]
 
Agile Data Science 2.0
Agile Data Science 2.0Agile Data Science 2.0
Agile Data Science 2.0
 

Recently uploaded

Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 

Recently uploaded (20)

Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 

03. oop concepts

  • 1. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 1 Haresh Jaiswal Rising Technologies, Jalna.
  • 2. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 2 Object Oriented Concepts  Objects  Classes  Data Abstraction  Encapsulation  Polymorphism  Inheritance
  • 3. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 3 Object  Objects are the basic run-time entities in an OOP environment.  They may represent:  a person,  a place,  a bank account or  any item that the program has to handle.  Objects are simply variables of type class. Or In pure OOP terms an object is an instance of a user defined data type class.
  • 4. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 4 Object  As the name object-oriented implies, objects are key to understand object-oriented technology.  You can look around you & can see many examples of real-world objects:  your cell phone,  your dog,  your television set,  your car.
  • 5. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 5 Object  All these real-world objects share two characteristics:  they all have state  and they all have behaviour
  • 6. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 6 Real-World Objects  A Real World Object : Dog  have state like 1. Name, 2. Colour, 3. Breed  have behaviours like 1. Barking, 2. Eating State Value Name Tommy Colour Brown Breed Labrador
  • 7. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 7 Real-World Objects  A Real World Object : Car  have state like 1. Brand, 2. Make, 3. Engine CC  have behaviours like 1. Accelerate, 2. Brake, 3. Change Gear State Value Brand Maruti Make Swift Engine CC 1248 CC
  • 8. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 8 Programmatic Objects  Software/Programmatic objects are modelled after real- world objects in that they too have state and behaviour.  A Programmatic object : Box  have state like  Height,  Width,  Depth  have behaviours like  getDimensions()  putVolume()
  • 9. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 9 Programmatic Objects  A Programmatic object : Bank Account  have state like  Acct No,  Acct Holder’s Name,  Current Balance  have behaviours like  Deposit(),  Withdrawal()
  • 10. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 10 Programmatic Objects  A Programmatic object : Employee  have state like  Employee ID,  Employee Name,  Basic Salary  have behaviours like  getData(),  putSalary()
  • 11. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 11 Programmatic Objects  Everything that the software object knows (its state) and can do (its behaviour) is expressed by the variables and methods within that object.  A software/programmatic object maintains:  its state in variables  implements its behaviour with methods/functions.
  • 12. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 12 Programming Objects Object : Student State (Data) RollNo Name M1, M2, M3 Behaviour (Functions) getData() putResult() Object : Employee State (Data) EmpNo Name Basic, Ta, Da, Gross Object : Box State (Data) Height Width Depth Behaviour (Functions) getDimensions() putVolume() Behaviour (Functions) getData() putSalary() Each object contains Data and Code to manipulate that Data Or An object is a bundle of variables and related methods/functions.
  • 13. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 13 Example of Objects  A software object that modelled your real-world box would have variables that indicates the box’s current state:  Height : 4  Width : 7  Depth : 6  The software object box would also have methods/functions to:  getDimensions() : to take dimensions as input from user  putVolume() : to calculate and print volume of box
  • 14. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 14 Example of Objects  A software object that modelled your real-world car would have variables that indicates the car’s current state:  speed : 10 mph,  pedal cadence : 90 rpm,  current gear is : 5th.  The software object car would also have methods/functions to:  brake,  change the pedal cadence,  change gears.
  • 15. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 15 Example of Objects  You can think of an object as a fancy variable;  it stores data and you can “make requests” to that object, asking it to perform operations on itself.
  • 16. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 16 Example of Objects  You can represent real-world objects using software objects. You can represent:  real-world dog as software object in an animation program.  real-world car as a software object within a game program.
  • 17. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 17 Class  Classes are actually special kinds of templates from which you can create objects.  Definition : Class is a way of binding Data and its associated Functions/Methods together.  When you define a class, you define a blueprint for an abstract data type.
  • 18. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 18 Class  A class is created to characterise your programmatic object.  Everything a programmatic object knows (its state) and can do (its behaviour) is characterised using variables and methods defined inside the class.  A class is a logical abstract but an object has a physical existence in the memory.
  • 19. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 19 Abstract Data Type  Defining a Class means creating an abstract data type in any object oriented programming language.  A data type can be called abstract, if it do not reveal its internal implementation to the user of that type.
  • 20. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 20 Abstract Data Type  There are 2 parts to each ADT:  The external (public) part, which consists of:  the conceptual picture (user's view of how the object looks like)  the conceptual operations (what the user can do to the ADT)  The internal (private) part, which consists of:  the representation (how the structure is actually stored)  the implementation of the operations (the actual code)
  • 21. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 21 Abstraction  In simple words, abstraction is ‘Hiding implementation details behind the interface’  When abstraction is created our concern is limited to what it can do rather how it is doing it.
  • 22. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 22 Abstraction  When we drive a car we often need to change the gears of the vehicle but we are not concerned about the inner details of the vehicle engine. What matters to us is that we must shift a gear, that's it. This is abstraction  Show only those details which matters to the user.
  • 23. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 23 Abstraction  What exactly is Hiding implementation details behind the interface?
  • 24. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 24 Abstraction class box { private: float h, w, d; public: void getDimensions() { cout << “Enter Height, Width & Depth : “; cin >> h >> w >> d; } void putVolume() { cout << “Volume : “ << (h * w * d); } }; Class Definition, the internal details/implementation of ADT
  • 25. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 25 Abstraction Object : Box State(Data) Height Width Depth Behaviour/Functions getDimensions() putVolume() An Object of Class Box, user has knowledge about its external interface only. Actual implementation, User has no knowledge about this part of object. External Interface to use this object, User has knowledge only about this part of the object.
  • 26. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 26 Encapsulation  The wrapping of code and data into a single unit is called as encapsulation.  Encapsulation binds together data and code to manipulate that data, it keeps both them safe from outside interference and mis-use.  Encapsulation is a protective container that prevents code and data from being accessed by other code defined outside the container.  Creating a Class is the way to implement Encapsulation.
  • 27. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 27 Encapsulation  Object encapsulates data and operations in one unit  An object is a bundle of data; who know how to do things to itself.
  • 28. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 28 Polymorphism  In object-oriented programming polymorphism means the ability to appear in many forms.  polymorphism refers to a programming language's ability to process objects differently depending on their data type or class.  It is the provision of a single interface to entities of different types.
  • 29. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 29 Polymorphism  An operation may perform different behaviors in different instances and the behavior depends upon the type of data used in the operation.
  • 30. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 30 Polymorphism  Consider the operation of adding two integer values using + operator, then the operation will generate a sum, but if operands in the operation is of string type then the operation would produce a third string by concatenation. 5 + 2 => 7 // integer operands “Rising” + “Tech” => “Rising Tech” // string operands
  • 31. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 31 Polymorphism  So this process of making an operator to perform different behaviors in different instances is known as “operator overloading”
  • 32. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 32 Polymorphism Class : Shape --------------------------- Draw() Object : Circle --------------------- Draw(circle) Object : Box --------------------- Draw(box) Object : Triangle --------------------- Draw(triangle) This figure illustrates that a single function name can be used to handle different number and different type of arguments.
  • 33. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 33 Polymorphism  Using a single function name to perform different types of tasks is known as ‘Function Overloading’  This is something similar to a particular word having several different meanings depending on the context. I Saw a Saw with a Saw Sawing a Saw...
  • 34. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 34 Virtual Functions  Virtual functions is the ability to redefine methods in derived classes.  For example, given a base class shape, polymorphism enables the programmer to define different area methods for any number of derived classes, such as circles, rectangles and triangles.  No matter what shape an object is, applying the area method to it will return the correct results.
  • 35. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 35 Polymorphism Polymorphism Compile Time Function Overloading Operator Overloading Runtime Virtual Functions
  • 36. Rising Technologies, Jalna (MH). + 91 9423156065, http://www.RisingTechnologies.in 36 Polymorphism  Polymorphism plays an important role in allowing objects to have different internal structures but to share the same external interface.