SlideShare a Scribd company logo
1 of 31
Download to read offline
Object Oriented
ConceptsConcepts
Mrs. Pranali P. Chaudhari
Contents
Procedural Programming Concepts
Object Oriented ConceptsObject Oriented Concepts
Features, Advantages and Applications of
OOP
Quiz 1
What is a programming language?
A programming language is a formal
language that specifies a set of instructions that
can be used to produce various kinds of output.
A language used by programmers to write
instructions that a computer can understand to do
what the programmer (or the computer user) wants.
Procedural Programming Techniques
Focuses on Functions.
Data items are defined as global.
All functions access the global data item freely.
Each function is having its own local data.
It employs top-down approach.
Procedural Programming Techniques
Global Data Global Data
Function - 1
Local Data
Function - 2
Local Data
Function - 3
Local Data
Quiz 2
Give example of procedural language.
C, FORTRAN, Pascal....
Who developed C language?
Dennis Ritchie
Object Oriented Programming
Focuses on Data.
Problem is decomposed into number entities
called objects.
Data is not defined as global
Data of an object can be accessed by the
functions associated with that object.
Functions of one object can access functions of
other objects.
Object Oriented Programming
Functions
Data
Object A
Functions
Data
Object B
Functions Functions
Functions
Data
Object C
Procedural Vs Object Oriented
Procedural Programming Object Oriented Programming
Focuses on Functions Focuses on Data
Uses/ define Global data Data is not defined as global
Functions access same data item Only the functions associated with
the object can access the data
item.
Top down approach Bottom up approach
Quiz 3
Give examples of Object Oriented
Languages.
C++, Java, C# ......
Who developed C++?
Bjarne Stroustrup
OOPS Basic Concepts
Objects
Data
Member functions
ClassClass
Data Abstraction and Encapsulation
Inheritance
Polymorphism
Dynamic Binding
Message Passing
Objects
OBJECT
DATA
Objects are the basic run-time
entities in an object oriented system.
For eg: person, bank account, an
FUNCTIONS
item.
Objects interacts with other objects
by sending messages to one another.
Each object consists of data items
and the functions to manipulate that
data.
Classes
A class is a collection of objects of similar type.
It is a user defined data type.
Object are variables of the type class.Object are variables of the type class.
For eg: mango, apple, orange are the objects of
fruit class.
Once the class is defined we can create any
number of objects.
Data Abstraction & Encapsulation
Wrapping up of data and functions into a single
unit is known as Encapsulation. Eg: quadratic
equations.
Abstraction refers to the act of representing
essential features without including the
background details. Eg: automobile company.
Inheritance
Inheritance is the process by which objects of
one class acquire the properties of objects of
another class.another class.
The concept of inheritance provides the idea of
reusability.
Class animals is divided into mammals,
amphibians, insects, birds etc.
Inheritance
Base Class
Feature A
Feature B
Feature A
Feature B
Feature C
Feature A
Feature B
Feature D
Feature A
Feature B
Feature F
Feature C
Derived Class
Polymorphism
Polymorphism means the ability to take
more than one form.
In oops it is achieved through:
Operator Overloading
Function Overloading.
Operator Overloading
The process of making an operator to
exhibit different behaviors in different
instances is known as operator
overloading.
Addition operation example.
Function Overloading
Shape
Using the same function name to perform
different type of tasks is known as function
overloading.
Draw()
Box Object
Draw(Box)
Triangle Object
Draw(Triangle)
Circle Object
Draw(Circle)
Dynamic Binding
Binding refers to the linking of a procedure
call to the code to be executed in
response to a call.
Dynamic Binding means the code
associated with the call is not known until
the time of the call at run-time.
Message Passing
A message for an object is a request for
execution of a procedure.
Message passing involves specifying the
name of the object, the name of the
function and the information to be sent.
employee.salary(name)
Features of OOPs
Emphasis is on data rather than procedure.
Programs are divided into objects.
Data structures are designed such that they characterise
the objects.
Functions that operate on data of an object are tiedFunctions that operate on data of an object are tied
together in the data structure.
Data is hidden and cannot be accessed by external
functions.
Objects may communicate with each other through
functions.
New data and functions can be easily added whenever
necessary.
Follows bottom up approach in program design.
Benefits of OOP
Modularity for easier troubleshooting
Reuse of code through inheritanceReuse of code through inheritance
Flexibility through polymorphism
Effective problem solving
Applications of OOP
Real time systems
Simulation and Modelling
Object Oriented Databases
AI and Expert Systems
Neural Network and parallel programming
Decision support and automation systems.
First C++ Program
# include<iostream.h>
using namespace std;
int main()int main()
{
cout<<“Hello World”;
return 0;
}
C Vs C++ Program
C Program
# include <stdio.h>
main()
C++ Program
# include <iostream>
using namespace std;
main()
{
printf(“Hello World”);
}
int main()
{
cout<< “ Hello World”;
return 0;
}
C++ Program with Class
# include<iostream>
using namespace std;
class person
{
char name[30];
int age;
public:
void person :: display(void)
{
cout << “n Name : “ << name;
cout << “n Age : “ << age;
}
int main()public:
void getdata(void);
void display(void);
};
void person :: getdata(void)
{
cout<< “ Enter Name : “;
cin>> name;
cout<<“ Enter Age : “;
cin>> age;
}
int main()
{
person p;
p.getdata();
p.display();
return 0 ;
}
Structure of C++ Program
Include Files
Class declaration
Member functions definitions
Main function Program
Summary
OOPs focuses on ____________.
________ is a run time entity.
Class is also known as _____________.
________ provides the idea of reusability.________ provides the idea of reusability.
Objects can communicate with each other
through _________.
Polymorphism is achieved through ________
and __________.
References
Object Oriented Programming with C++ by
E Balagurusamy.E Balagurusamy.
END OF UNIT

More Related Content

What's hot

Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programmingAmit Soni (CTFL)
 
Variables & Data Types In Python | Edureka
Variables & Data Types In Python | EdurekaVariables & Data Types In Python | Edureka
Variables & Data Types In Python | EdurekaEdureka!
 
Basic i/o & file handling in java
Basic i/o & file handling in javaBasic i/o & file handling in java
Basic i/o & file handling in javaJayasankarPR2
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Conceptsthinkphp
 
Introduction to oop
Introduction to oop Introduction to oop
Introduction to oop Kumar
 
Object oriented programming concepts
Object oriented programming conceptsObject oriented programming concepts
Object oriented programming conceptsrahuld115
 
Multiple inheritance possible in Java
Multiple inheritance possible in JavaMultiple inheritance possible in Java
Multiple inheritance possible in JavaKurapati Vishwak
 
Classes and Objects in C#
Classes and Objects in C#Classes and Objects in C#
Classes and Objects in C#Adeel Rasheed
 
Virtual base class
Virtual base classVirtual base class
Virtual base classTech_MX
 
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 PythonSujith Kumar
 
Fundamentals of Python Programming
Fundamentals of Python ProgrammingFundamentals of Python Programming
Fundamentals of Python ProgrammingKamal Acharya
 
Advance OOP concepts in Python
Advance OOP concepts in PythonAdvance OOP concepts in Python
Advance OOP concepts in PythonSujith Kumar
 

What's hot (20)

Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Variables & Data Types In Python | Edureka
Variables & Data Types In Python | EdurekaVariables & Data Types In Python | Edureka
Variables & Data Types In Python | Edureka
 
Python OOPs
Python OOPsPython OOPs
Python OOPs
 
Basic i/o & file handling in java
Basic i/o & file handling in javaBasic i/o & file handling in java
Basic i/o & file handling in java
 
Functions in Python
Functions in PythonFunctions in Python
Functions in Python
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
OOPS Basics With Example
OOPS Basics With ExampleOOPS Basics With Example
OOPS Basics With Example
 
Introduction to oop
Introduction to oop Introduction to oop
Introduction to oop
 
Object oriented programming concepts
Object oriented programming conceptsObject oriented programming concepts
Object oriented programming concepts
 
concept of oops
concept of oopsconcept of oops
concept of oops
 
Multiple inheritance possible in Java
Multiple inheritance possible in JavaMultiple inheritance possible in Java
Multiple inheritance possible in Java
 
Python Objects
Python ObjectsPython Objects
Python Objects
 
Classes and Objects in C#
Classes and Objects in C#Classes and Objects in C#
Classes and Objects in C#
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
Oop concepts in python
Oop concepts in pythonOop concepts in python
Oop concepts in python
 
Virtual base class
Virtual base classVirtual base class
Virtual base class
 
Ppt of c vs c#
Ppt of c vs c#Ppt of c vs c#
Ppt of c vs c#
 
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
 
Fundamentals of Python Programming
Fundamentals of Python ProgrammingFundamentals of Python Programming
Fundamentals of Python Programming
 
Advance OOP concepts in Python
Advance OOP concepts in PythonAdvance OOP concepts in Python
Advance OOP concepts in Python
 

Similar to Object oriented concepts

Similar to Object oriented concepts (20)

OOPS_Unit_1
OOPS_Unit_1OOPS_Unit_1
OOPS_Unit_1
 
Chapter1 introduction
Chapter1 introductionChapter1 introduction
Chapter1 introduction
 
OOP.pptx
OOP.pptxOOP.pptx
OOP.pptx
 
POP vs OOP Introduction
POP vs OOP IntroductionPOP vs OOP Introduction
POP vs OOP Introduction
 
Bca 2nd sem u-1 iintroduction
Bca 2nd sem u-1 iintroductionBca 2nd sem u-1 iintroduction
Bca 2nd sem u-1 iintroduction
 
C++Day-1 Introduction.ppt
C++Day-1 Introduction.pptC++Day-1 Introduction.ppt
C++Day-1 Introduction.ppt
 
Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Language
 
Object Oriented Programming Lecture Notes
Object Oriented Programming Lecture NotesObject Oriented Programming Lecture Notes
Object Oriented Programming Lecture Notes
 
Object oriented programming C++
Object oriented programming C++Object oriented programming C++
Object oriented programming C++
 
Oops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in JavaOops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in Java
 
Mca 2 sem u-1 iintroduction
Mca 2 sem u-1 iintroductionMca 2 sem u-1 iintroduction
Mca 2 sem u-1 iintroduction
 
OOP ppt.pdf
OOP ppt.pdfOOP ppt.pdf
OOP ppt.pdf
 
JAVA PROGRAMMING
JAVA PROGRAMMING JAVA PROGRAMMING
JAVA PROGRAMMING
 
Birasa 1
Birasa 1Birasa 1
Birasa 1
 
chapter - 1.ppt
chapter - 1.pptchapter - 1.ppt
chapter - 1.ppt
 
1 intro
1 intro1 intro
1 intro
 
CPP_,module2_1.pptx
CPP_,module2_1.pptxCPP_,module2_1.pptx
CPP_,module2_1.pptx
 
JAVA PROGRAMMINGD
JAVA PROGRAMMINGDJAVA PROGRAMMINGD
JAVA PROGRAMMINGD
 
Chapter1
Chapter1Chapter1
Chapter1
 
INTRODUCTION TO JAVA
INTRODUCTION TO JAVAINTRODUCTION TO JAVA
INTRODUCTION TO JAVA
 

More from Pranali Chaudhari (9)

Exception handling
Exception handlingException handling
Exception handling
 
Files and streams
Files and streamsFiles and streams
Files and streams
 
Templates
TemplatesTemplates
Templates
 
Managing I/O in c++
Managing I/O in c++Managing I/O in c++
Managing I/O in c++
 
Inheritance
InheritanceInheritance
Inheritance
 
Operator overloading
Operator overloadingOperator overloading
Operator overloading
 
Constructors destructors
Constructors destructorsConstructors destructors
Constructors destructors
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
Introduction to C++
Introduction to C++Introduction to C++
Introduction to C++
 

Recently uploaded

CHUYÊN ĐỀ ÔN THEO CÂU CHO HỌC SINH LỚP 12 ĐỂ ĐẠT ĐIỂM 5+ THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN THEO CÂU CHO HỌC SINH LỚP 12 ĐỂ ĐẠT ĐIỂM 5+ THI TỐT NGHIỆP THPT ...CHUYÊN ĐỀ ÔN THEO CÂU CHO HỌC SINH LỚP 12 ĐỂ ĐẠT ĐIỂM 5+ THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN THEO CÂU CHO HỌC SINH LỚP 12 ĐỂ ĐẠT ĐIỂM 5+ THI TỐT NGHIỆP THPT ...Nguyen Thanh Tu Collection
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxDhatriParmar
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...Nguyen Thanh Tu Collection
 
Comparative Literature in India by Amiya dev.pptx
Comparative Literature in India by Amiya dev.pptxComparative Literature in India by Amiya dev.pptx
Comparative Literature in India by Amiya dev.pptxAvaniJani1
 
DiskStorage_BasicFileStructuresandHashing.pdf
DiskStorage_BasicFileStructuresandHashing.pdfDiskStorage_BasicFileStructuresandHashing.pdf
DiskStorage_BasicFileStructuresandHashing.pdfChristalin Nelson
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 
How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17Celine George
 
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFEPART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFEMISSRITIMABIOLOGYEXP
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
The role of Geography in climate education: science and active citizenship
The role of Geography in climate education: science and active citizenshipThe role of Geography in climate education: science and active citizenship
The role of Geography in climate education: science and active citizenshipKarl Donert
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfChristalin Nelson
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
Employablity presentation and Future Career Plan.pptx
Employablity presentation and Future Career Plan.pptxEmployablity presentation and Future Career Plan.pptx
Employablity presentation and Future Career Plan.pptxryandux83rd
 

Recently uploaded (20)

CHUYÊN ĐỀ ÔN THEO CÂU CHO HỌC SINH LỚP 12 ĐỂ ĐẠT ĐIỂM 5+ THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN THEO CÂU CHO HỌC SINH LỚP 12 ĐỂ ĐẠT ĐIỂM 5+ THI TỐT NGHIỆP THPT ...CHUYÊN ĐỀ ÔN THEO CÂU CHO HỌC SINH LỚP 12 ĐỂ ĐẠT ĐIỂM 5+ THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN THEO CÂU CHO HỌC SINH LỚP 12 ĐỂ ĐẠT ĐIỂM 5+ THI TỐT NGHIỆP THPT ...
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
 
Comparative Literature in India by Amiya dev.pptx
Comparative Literature in India by Amiya dev.pptxComparative Literature in India by Amiya dev.pptx
Comparative Literature in India by Amiya dev.pptx
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
DiskStorage_BasicFileStructuresandHashing.pdf
DiskStorage_BasicFileStructuresandHashing.pdfDiskStorage_BasicFileStructuresandHashing.pdf
DiskStorage_BasicFileStructuresandHashing.pdf
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 
How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17
 
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFEPART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
The role of Geography in climate education: science and active citizenship
The role of Geography in climate education: science and active citizenshipThe role of Geography in climate education: science and active citizenship
The role of Geography in climate education: science and active citizenship
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdf
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
Employablity presentation and Future Career Plan.pptx
Employablity presentation and Future Career Plan.pptxEmployablity presentation and Future Career Plan.pptx
Employablity presentation and Future Career Plan.pptx
 

Object oriented concepts

  • 2. Contents Procedural Programming Concepts Object Oriented ConceptsObject Oriented Concepts Features, Advantages and Applications of OOP
  • 3. Quiz 1 What is a programming language? A programming language is a formal language that specifies a set of instructions that can be used to produce various kinds of output. A language used by programmers to write instructions that a computer can understand to do what the programmer (or the computer user) wants.
  • 4. Procedural Programming Techniques Focuses on Functions. Data items are defined as global. All functions access the global data item freely. Each function is having its own local data. It employs top-down approach.
  • 5. Procedural Programming Techniques Global Data Global Data Function - 1 Local Data Function - 2 Local Data Function - 3 Local Data
  • 6. Quiz 2 Give example of procedural language. C, FORTRAN, Pascal.... Who developed C language? Dennis Ritchie
  • 7. Object Oriented Programming Focuses on Data. Problem is decomposed into number entities called objects. Data is not defined as global Data of an object can be accessed by the functions associated with that object. Functions of one object can access functions of other objects.
  • 8. Object Oriented Programming Functions Data Object A Functions Data Object B Functions Functions Functions Data Object C
  • 9. Procedural Vs Object Oriented Procedural Programming Object Oriented Programming Focuses on Functions Focuses on Data Uses/ define Global data Data is not defined as global Functions access same data item Only the functions associated with the object can access the data item. Top down approach Bottom up approach
  • 10. Quiz 3 Give examples of Object Oriented Languages. C++, Java, C# ...... Who developed C++? Bjarne Stroustrup
  • 11. OOPS Basic Concepts Objects Data Member functions ClassClass Data Abstraction and Encapsulation Inheritance Polymorphism Dynamic Binding Message Passing
  • 12. Objects OBJECT DATA Objects are the basic run-time entities in an object oriented system. For eg: person, bank account, an FUNCTIONS item. Objects interacts with other objects by sending messages to one another. Each object consists of data items and the functions to manipulate that data.
  • 13. Classes A class is a collection of objects of similar type. It is a user defined data type. Object are variables of the type class.Object are variables of the type class. For eg: mango, apple, orange are the objects of fruit class. Once the class is defined we can create any number of objects.
  • 14. Data Abstraction & Encapsulation Wrapping up of data and functions into a single unit is known as Encapsulation. Eg: quadratic equations. Abstraction refers to the act of representing essential features without including the background details. Eg: automobile company.
  • 15. Inheritance Inheritance is the process by which objects of one class acquire the properties of objects of another class.another class. The concept of inheritance provides the idea of reusability. Class animals is divided into mammals, amphibians, insects, birds etc.
  • 16. Inheritance Base Class Feature A Feature B Feature A Feature B Feature C Feature A Feature B Feature D Feature A Feature B Feature F Feature C Derived Class
  • 17. Polymorphism Polymorphism means the ability to take more than one form. In oops it is achieved through: Operator Overloading Function Overloading.
  • 18. Operator Overloading The process of making an operator to exhibit different behaviors in different instances is known as operator overloading. Addition operation example.
  • 19. Function Overloading Shape Using the same function name to perform different type of tasks is known as function overloading. Draw() Box Object Draw(Box) Triangle Object Draw(Triangle) Circle Object Draw(Circle)
  • 20. Dynamic Binding Binding refers to the linking of a procedure call to the code to be executed in response to a call. Dynamic Binding means the code associated with the call is not known until the time of the call at run-time.
  • 21. Message Passing A message for an object is a request for execution of a procedure. Message passing involves specifying the name of the object, the name of the function and the information to be sent. employee.salary(name)
  • 22. Features of OOPs Emphasis is on data rather than procedure. Programs are divided into objects. Data structures are designed such that they characterise the objects. Functions that operate on data of an object are tiedFunctions that operate on data of an object are tied together in the data structure. Data is hidden and cannot be accessed by external functions. Objects may communicate with each other through functions. New data and functions can be easily added whenever necessary. Follows bottom up approach in program design.
  • 23. Benefits of OOP Modularity for easier troubleshooting Reuse of code through inheritanceReuse of code through inheritance Flexibility through polymorphism Effective problem solving
  • 24. Applications of OOP Real time systems Simulation and Modelling Object Oriented Databases AI and Expert Systems Neural Network and parallel programming Decision support and automation systems.
  • 25. First C++ Program # include<iostream.h> using namespace std; int main()int main() { cout<<“Hello World”; return 0; }
  • 26. C Vs C++ Program C Program # include <stdio.h> main() C++ Program # include <iostream> using namespace std; main() { printf(“Hello World”); } int main() { cout<< “ Hello World”; return 0; }
  • 27. C++ Program with Class # include<iostream> using namespace std; class person { char name[30]; int age; public: void person :: display(void) { cout << “n Name : “ << name; cout << “n Age : “ << age; } int main()public: void getdata(void); void display(void); }; void person :: getdata(void) { cout<< “ Enter Name : “; cin>> name; cout<<“ Enter Age : “; cin>> age; } int main() { person p; p.getdata(); p.display(); return 0 ; }
  • 28. Structure of C++ Program Include Files Class declaration Member functions definitions Main function Program
  • 29. Summary OOPs focuses on ____________. ________ is a run time entity. Class is also known as _____________. ________ provides the idea of reusability.________ provides the idea of reusability. Objects can communicate with each other through _________. Polymorphism is achieved through ________ and __________.
  • 30. References Object Oriented Programming with C++ by E Balagurusamy.E Balagurusamy.