SlideShare a Scribd company logo
1 of 12
Introduction to Object-Oriented Programming
• Object-oriented programming aims to implement real-world entities.
• The main aim of OOP is to bind together the data and the functions that operate on
them so that no other part of the code can access this data except that function.
• Object oriented programming can be defined as a programming model which is
based upon the concept of objects.
• Objects contain data in the form of attributes and code in the form of methods.
• In object oriented programming, computer programs are designed using the concept
of objects that represent real world object.
Some of the Object Oriented Programming Languages :
Java, C++, C#, Python,
PHP, JavaScript, Ruby, Perl,
Objective-C, Dart, Swift, Scala.
1
Characteristics of OOP
2
CLASS
• The building block of C++ that leads to Object-Oriented programming is a Class.
• It is a user-defined data type, which holds its own data members and member
functions, which can be accessed and used by creating an instance of that class.
• A class is like a blueprint for an object.
• A Class is a user-defined data-type which has data members and member
functions.
• Data members are the data variables and member functions are the functions
used to manipulate these variables and together these data members and
member functions define the properties and behavior of the objects in a Class.
• In the example of class Car, the data member will be speed limit, mileage etc and
member functions can apply brakes, increase speed etc.
3
OBJECT
• An Object is an identifiable entity with some characteristics and behavior. An
Object is an instance of a Class. When a class is defined, no memory is allocated
but when it is instantiated (i.e. an object is created) memory is allocated.
• Object take up space in memory and have an associated address like a record in
pascal or structure or union in C.
• When a program is executed the objects interact by sending messages to one
another.
Message Passing: Objects communicate with one another by sending and receiving
information to each other. A message for an object is a request for execution of a
procedure and therefore will invoke a function in the receiving object that
generates the desired results. Message passing involves specifying the name of the
object, the name of the function and the information to be sent.
4
Class Vs Object
5
Encapsulation Abstraction
Inheritance
6
• Encapsulation is defined as wrapping up of data and information under a single
unit. In Object-Oriented Programming, Encapsulation is defined as binding
together the data and the functions that manipulate them. Encapsulation also
leads to data abstraction or hiding.
• Abstraction means displaying only essential information and hiding the details.
Data abstraction refers to providing only essential information about the data to
the outside world, hiding the background details or implementation.
7
Inheritance: The capability of a class to derive properties and characteristics from
another class is called Inheritance. Inheritance is one of the most important
features of Object-Oriented Programming.
• Sub Class: The class that inherits properties from another class is called Sub class
or Derived Class.
• Super Class: The class whose properties are inherited by sub class is called Base
Class or Super class.
• Reusability: Inheritance supports the concept of “reusability”, i.e. when we want
to create a new class and there is already a class that includes some of the code
that we want, we can derive our new class from the existing class. By doing this,
we are reusing the fields and methods of the existing class.
8
• Polymorphism: The word polymorphism means having many forms. In simple
words, we can define polymorphism as the ability of a message to be displayed in
more than one form.
• An operation may exhibit different behaviours in different instances. The
behaviour depends upon the types of data used in the operation.
C++ supports operator overloading and function overloading.
• Operator Overloading: The process of making an operator to exhibit different
behaviours in different instances is known as operator overloading.
• Function Overloading: Function overloading is using a single function name to
perform different types of tasks.
Polymorphism is extensively used in implementing inheritance.
9
Advantages of OOP
• A real-world idea can be demonstrated, as everything in OOP is treated as an
object.
• As we use the concept of encapsulation, programs are easier to test and
maintain.
• Faster development of code is done as we develop classes parallel instead of
sequentially.
• OOP provides greater security due to data abstraction. The outside world cannot
access the hidden data.
• Reusability can be achieved through inheritance by using classes that have been
already written.
• Flexibility through polymorphism.
10
Advantages of OOP contd..
•OOP systems can be easily upgraded from small to large systems.
•It is possible that multiple instances of objects co-exist without any interference,
•It is very easy to partition the work in a project based on objects.
•OOP language allows to break the program into the bit-sized problems that can be
solved easily (one object at a time).
11
Comparison POP vs OOP
Procedural Oriented Programming Object Oriented Programming
Structure oriented Object oriented
Program is divided into functions. Program is divided objects.
Procedural programming follows top down approach. Object oriented programming follows bottom up approach.
No access specifier in procedural programming. Have access specifiers like private, public, protected etc.
Adding new data and function is not easy. Adding new data and function is easy.
No data hiding. Encapsulation is used to hide the data.
Does not have provision for hiding data so it is less secure. Provides data hiding so it is more secure.
No virtual function. Concept of virtual function.
Overloading is not possible. Overloading is possible
Function is more important than data. Data is more important than function.
Examples: C, FORTRAN, Pascal, Basic etc. Examples: C++, Java, Python, C# etc.
12

More Related Content

Similar to Principles of OOPs.pptx

gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrdgxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrdwrushabhsirsat
 
1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt
1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt
1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.pptsagarjsicg
 
Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP conceptsAhmed Farag
 
Object oriented programming 6 oop with c++
Object oriented programming 6  oop with c++Object oriented programming 6  oop with c++
Object oriented programming 6 oop with c++Vaibhav Khanna
 
C++ in object oriented programming
C++ in object oriented programmingC++ in object oriented programming
C++ in object oriented programmingSaket Khopkar
 
Need of object oriented programming
Need of object oriented programmingNeed of object oriented programming
Need of object oriented programmingAmar Jukuntla
 
Lesson 1 - Object Oriented Programming CPP103.pptx
Lesson 1 - Object Oriented Programming CPP103.pptxLesson 1 - Object Oriented Programming CPP103.pptx
Lesson 1 - Object Oriented Programming CPP103.pptxLuiFlor
 
JAVA - Oops Concept.pptx
JAVA - Oops Concept.pptxJAVA - Oops Concept.pptx
JAVA - Oops Concept.pptxayankamila005
 
POP vs OOP Introduction
POP vs OOP IntroductionPOP vs OOP Introduction
POP vs OOP IntroductionHashni T
 
Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)MD Sulaiman
 
Principles and advantages of oop ppt
Principles and advantages of oop pptPrinciples and advantages of oop ppt
Principles and advantages of oop pptdaxesh chauhan
 
Basic Concepts of Object Oriented Programming using C++
Basic Concepts of Object Oriented Programming using C++Basic Concepts of Object Oriented Programming using C++
Basic Concepts of Object Oriented Programming using C++ShivamPathak318367
 

Similar to Principles of OOPs.pptx (20)

gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrdgxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
 
1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt
1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt
1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt
 
Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP concepts
 
OOPS_Unit_1
OOPS_Unit_1OOPS_Unit_1
OOPS_Unit_1
 
Object oriented programming 6 oop with c++
Object oriented programming 6  oop with c++Object oriented programming 6  oop with c++
Object oriented programming 6 oop with c++
 
C++ in object oriented programming
C++ in object oriented programmingC++ in object oriented programming
C++ in object oriented programming
 
Need of object oriented programming
Need of object oriented programmingNeed of object oriented programming
Need of object oriented programming
 
Benefits of encapsulation
Benefits of encapsulationBenefits of encapsulation
Benefits of encapsulation
 
Basic concept of OOP's
Basic concept of OOP'sBasic concept of OOP's
Basic concept of OOP's
 
Unit 1 OOSE
Unit 1 OOSE Unit 1 OOSE
Unit 1 OOSE
 
Lesson 1 - Object Oriented Programming CPP103.pptx
Lesson 1 - Object Oriented Programming CPP103.pptxLesson 1 - Object Oriented Programming CPP103.pptx
Lesson 1 - Object Oriented Programming CPP103.pptx
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
JAVA - Oops Concept.pptx
JAVA - Oops Concept.pptxJAVA - Oops Concept.pptx
JAVA - Oops Concept.pptx
 
POP vs OOP Introduction
POP vs OOP IntroductionPOP vs OOP Introduction
POP vs OOP Introduction
 
Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)
 
80410172053.pdf
80410172053.pdf80410172053.pdf
80410172053.pdf
 
Chapter1
Chapter1Chapter1
Chapter1
 
Principles and advantages of oop ppt
Principles and advantages of oop pptPrinciples and advantages of oop ppt
Principles and advantages of oop ppt
 
Basic Concepts of Object Oriented Programming using C++
Basic Concepts of Object Oriented Programming using C++Basic Concepts of Object Oriented Programming using C++
Basic Concepts of Object Oriented Programming using C++
 
OBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptx
OBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptxOBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptx
OBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptx
 

Recently uploaded

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
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
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
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
 
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
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
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
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
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
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 

Recently uploaded (20)

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
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
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
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
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
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
 
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
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
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
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
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
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 

Principles of OOPs.pptx

  • 1. Introduction to Object-Oriented Programming • Object-oriented programming aims to implement real-world entities. • The main aim of OOP is to bind together the data and the functions that operate on them so that no other part of the code can access this data except that function. • Object oriented programming can be defined as a programming model which is based upon the concept of objects. • Objects contain data in the form of attributes and code in the form of methods. • In object oriented programming, computer programs are designed using the concept of objects that represent real world object. Some of the Object Oriented Programming Languages : Java, C++, C#, Python, PHP, JavaScript, Ruby, Perl, Objective-C, Dart, Swift, Scala. 1
  • 3. CLASS • The building block of C++ that leads to Object-Oriented programming is a Class. • It is a user-defined data type, which holds its own data members and member functions, which can be accessed and used by creating an instance of that class. • A class is like a blueprint for an object. • A Class is a user-defined data-type which has data members and member functions. • Data members are the data variables and member functions are the functions used to manipulate these variables and together these data members and member functions define the properties and behavior of the objects in a Class. • In the example of class Car, the data member will be speed limit, mileage etc and member functions can apply brakes, increase speed etc. 3
  • 4. OBJECT • An Object is an identifiable entity with some characteristics and behavior. An Object is an instance of a Class. When a class is defined, no memory is allocated but when it is instantiated (i.e. an object is created) memory is allocated. • Object take up space in memory and have an associated address like a record in pascal or structure or union in C. • When a program is executed the objects interact by sending messages to one another. Message Passing: Objects communicate with one another by sending and receiving information to each other. A message for an object is a request for execution of a procedure and therefore will invoke a function in the receiving object that generates the desired results. Message passing involves specifying the name of the object, the name of the function and the information to be sent. 4
  • 7. • Encapsulation is defined as wrapping up of data and information under a single unit. In Object-Oriented Programming, Encapsulation is defined as binding together the data and the functions that manipulate them. Encapsulation also leads to data abstraction or hiding. • Abstraction means displaying only essential information and hiding the details. Data abstraction refers to providing only essential information about the data to the outside world, hiding the background details or implementation. 7
  • 8. Inheritance: The capability of a class to derive properties and characteristics from another class is called Inheritance. Inheritance is one of the most important features of Object-Oriented Programming. • Sub Class: The class that inherits properties from another class is called Sub class or Derived Class. • Super Class: The class whose properties are inherited by sub class is called Base Class or Super class. • Reusability: Inheritance supports the concept of “reusability”, i.e. when we want to create a new class and there is already a class that includes some of the code that we want, we can derive our new class from the existing class. By doing this, we are reusing the fields and methods of the existing class. 8
  • 9. • Polymorphism: The word polymorphism means having many forms. In simple words, we can define polymorphism as the ability of a message to be displayed in more than one form. • An operation may exhibit different behaviours in different instances. The behaviour depends upon the types of data used in the operation. C++ supports operator overloading and function overloading. • Operator Overloading: The process of making an operator to exhibit different behaviours in different instances is known as operator overloading. • Function Overloading: Function overloading is using a single function name to perform different types of tasks. Polymorphism is extensively used in implementing inheritance. 9
  • 10. Advantages of OOP • A real-world idea can be demonstrated, as everything in OOP is treated as an object. • As we use the concept of encapsulation, programs are easier to test and maintain. • Faster development of code is done as we develop classes parallel instead of sequentially. • OOP provides greater security due to data abstraction. The outside world cannot access the hidden data. • Reusability can be achieved through inheritance by using classes that have been already written. • Flexibility through polymorphism. 10
  • 11. Advantages of OOP contd.. •OOP systems can be easily upgraded from small to large systems. •It is possible that multiple instances of objects co-exist without any interference, •It is very easy to partition the work in a project based on objects. •OOP language allows to break the program into the bit-sized problems that can be solved easily (one object at a time). 11
  • 12. Comparison POP vs OOP Procedural Oriented Programming Object Oriented Programming Structure oriented Object oriented Program is divided into functions. Program is divided objects. Procedural programming follows top down approach. Object oriented programming follows bottom up approach. No access specifier in procedural programming. Have access specifiers like private, public, protected etc. Adding new data and function is not easy. Adding new data and function is easy. No data hiding. Encapsulation is used to hide the data. Does not have provision for hiding data so it is less secure. Provides data hiding so it is more secure. No virtual function. Concept of virtual function. Overloading is not possible. Overloading is possible Function is more important than data. Data is more important than function. Examples: C, FORTRAN, Pascal, Basic etc. Examples: C++, Java, Python, C# etc. 12