SlideShare a Scribd company logo
1 of 17
Download to read offline
OOP
(Object Oriented Programming)
https://htree.plus/
Presented By,
Nisarg Raval
Kadam Parikh
Kishan Sakariya
Ria Jain
What is OOP & 4-pillar?
❏ Object-oriented programming
(OOP) is a programming language
model in which programs are
organized around data, or objects,
rather than functions and logic.
https://htree.plus/
Encapsulation
Inheritance
Polymorphism AbstractionOOP
(4-pillar)
https://htree.plus/
Inheritance
❏ Concepts at higher levels are more general.
❏ Concepts at lower levels are more specific (inherit properties of
concepts at higher levels)
Vehicle
Wheeled Vehicle Boat
Car Bicycle
Inheritance
(By Programming)
https://htree.plus/
❏ The language mechanism by which one class acquires the
properties (data and operations) of another class
❏ Base Class (or superclass): the class being inherited from
❏ Derived Class (or subclass): the class that inherits
https://htree.plus/
❏ You can reuse the methods and data of the existing class
❏ You can extend the existing class by adding new data and new
methods
❏ You can modify the existing class by overloading its methods
with your own implementations
Advantages Of Inheritance
https://htree.plus/
Abstraction
❏ Objects in an OOP language provide an abstraction that hides
the internal implementation details.
❏ Abstraction refers to the concept of hiding the complexities of
a system from the users of that system
Abstraction
(Real World Example)
● For example, the coffee machine in your kitchen, you just
need to know which methods of the object are available to
call and which input parameters are needed to trigger a
specific operation. But you don’t need to understand how
this method is implemented and which kinds of actions it
has to perform to create the expected result.
Abstraction
(By Programming)
using namespace std;
class implementAbstraction
{
private:
int a, b;
public:
// method to set values of
// private members
void set(int x, int y)
{
a = x;
b = y;
}
void display()
{
cout<<"a = " <<a << endl;
cout<<"b = " << b << endl;
}
};
int main()
{
implementAbstraction obj;
obj.set(10, 20);
obj.display();
return 0;
}
https://htree.plus/
Encapsulation
❏ Encapsulation is a process of combining
data members and functions in a single
unit called class.
https://htree.plus/
Encapsulation
(Example)
❏ using System;
❏ namespace OPPs {
❏ class Encapsulation {
❏ private string Name = "Alex";
❏ public string EmployeeName { // Property
❏ get {
❏ return Name;
❏ }
❏ set {
❏ Name = value;
❏ }
❏ }
❏ static void Main(string[] args) {
❏ string Name2 = string.Empty;
❏ // use properties
❏ Encapsulation e = new Encapsulation();
❏ Name2 = e.EmployeeName;
❏ Console.WriteLine("Employee Name: " + Name2);
❏ Console.ReadLine();
❏ }
❏ }
❏ }
https://htree.plus/
Advantages Of
Encapsulation & Abstraction
❏ Encapsulation helps us in binding the data(instance
variables) and the member functions(that work on the
instance variables) of a class.
❏ Abstraction helps the user to avoid writing the low level code
❏ Abstraction avoids code duplication and increases
reusability.
❏ Abstraction can change internal implementation of class
independently without affecting the user.
https://htree.plus/
Polymorphism
(By Real World Example)
● The word ‘polymorphism’ literally means ‘a state of having
many shapes’ or ‘the capacity to take on different forms’.
https://htree.plus/
Polymorphism
(By Programming)
❏ Two types of polymorphism :
- Dynamic Polymorphism
- Static Polymorphism
❏ The process of binding the overloaded method within object at
compile time is known as Static polymorphism
❏ In dynamic polymorphism method of the program binds with
an object at runtime
https://htree.plus/
Polymorphism
(By Progamming)
https://htree.plus/
Advantages Of Polymorphism
❏ It helps programmers reuse the code and classes once written,
tested and implemented. They can be reused in many ways.
❏ Single variable name can be used to store variables of multiple
data types(Float, double, Long, Int etc).
❏ Polymorphism helps in reducing the coupling between
different functionalities.
References
❏ https://medium.com/omarelgabrys-blog/the-story-of-object-oriented-programming-
12d1901a1825
❏ https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html
❏ http://cs.smu.ca/~porter/csc/465/notes/oop.html
❏ https://atomicobject.com/resources/oo-programming/oo-quality
❏ https://medium.com/from-the-scratch/oop-everything-you-need-to-know-about-object-
oriented-programming-aee3c18e281b
❏ https://www.javatpoint.com/java-oops-concepts
❏ https://tomassetti.me/oops-concepts/
❏ http://www.differencebetween.net/technology/difference-between-oop-and-pop/
❏ https://en.wikipedia.org/wiki/Object-oriented_programming
❏ https://en.wikipedia.org/wiki/Access_modifiers
https://htree.plus/
THANK YOU
https://htree.plus/

More Related Content

What's hot

C++ - Constructors,Destructors, Operator overloading and Type conversion
C++ - Constructors,Destructors, Operator overloading and Type conversionC++ - Constructors,Destructors, Operator overloading and Type conversion
C++ - Constructors,Destructors, Operator overloading and Type conversionHashni T
 
Multiple Inheritance
Multiple InheritanceMultiple Inheritance
Multiple InheritanceBhavyaJain137
 
Error managing and exception handling in java
Error managing and exception handling in javaError managing and exception handling in java
Error managing and exception handling in javaAndhra University
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScriptMarlon Jamera
 
Inheritance in C++
Inheritance in C++Inheritance in C++
Inheritance in C++Laxman Puri
 
OOP - Understanding association, aggregation, composition and dependency
OOP - Understanding association, aggregation, composition and dependencyOOP - Understanding association, aggregation, composition and dependency
OOP - Understanding association, aggregation, composition and dependencyMudasir Qazi
 
Concept of OOPS with real life examples
Concept of OOPS with real life examplesConcept of OOPS with real life examples
Concept of OOPS with real life examplesNeha Sharma
 
Exception handling in c++
Exception handling in c++Exception handling in c++
Exception handling in c++imran khan
 
Spring vs java ee
Spring vs java eeSpring vs java ee
Spring vs java eeWalid Yaich
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming ConceptsAbhigyan Singh Yadav
 
Inheritance and its types In Java
Inheritance and its types In JavaInheritance and its types In Java
Inheritance and its types In JavaMD SALEEM QAISAR
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Michelle Anne Meralpis
 
백기선의 스프링 부트
백기선의 스프링 부트백기선의 스프링 부트
백기선의 스프링 부트Keesun Baik
 
[OOP - Lec 08] Encapsulation (Information Hiding)
[OOP - Lec 08] Encapsulation (Information Hiding)[OOP - Lec 08] Encapsulation (Information Hiding)
[OOP - Lec 08] Encapsulation (Information Hiding)Muhammad Hammad Waseem
 
스프링 시큐리티 구조 이해
스프링 시큐리티 구조 이해스프링 시큐리티 구조 이해
스프링 시큐리티 구조 이해beom kyun choi
 

What's hot (20)

C++ - Constructors,Destructors, Operator overloading and Type conversion
C++ - Constructors,Destructors, Operator overloading and Type conversionC++ - Constructors,Destructors, Operator overloading and Type conversion
C++ - Constructors,Destructors, Operator overloading and Type conversion
 
Multiple Inheritance
Multiple InheritanceMultiple Inheritance
Multiple Inheritance
 
Error managing and exception handling in java
Error managing and exception handling in javaError managing and exception handling in java
Error managing and exception handling in java
 
Java Object Oriented Programming
Java Object Oriented Programming Java Object Oriented Programming
Java Object Oriented Programming
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
Inheritance in C++
Inheritance in C++Inheritance in C++
Inheritance in C++
 
Oops
OopsOops
Oops
 
OOP - Understanding association, aggregation, composition and dependency
OOP - Understanding association, aggregation, composition and dependencyOOP - Understanding association, aggregation, composition and dependency
OOP - Understanding association, aggregation, composition and dependency
 
Concept of OOPS with real life examples
Concept of OOPS with real life examplesConcept of OOPS with real life examples
Concept of OOPS with real life examples
 
Exception handling in c++
Exception handling in c++Exception handling in c++
Exception handling in c++
 
Spring vs java ee
Spring vs java eeSpring vs java ee
Spring vs java ee
 
Oop concepts
Oop conceptsOop concepts
Oop concepts
 
Java programming -Object-Oriented Thinking- Inheritance
Java programming -Object-Oriented Thinking- InheritanceJava programming -Object-Oriented Thinking- Inheritance
Java programming -Object-Oriented Thinking- Inheritance
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
Inheritance and its types In Java
Inheritance and its types In JavaInheritance and its types In Java
Inheritance and its types In Java
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
 
백기선의 스프링 부트
백기선의 스프링 부트백기선의 스프링 부트
백기선의 스프링 부트
 
PHP Regular Expressions
PHP Regular ExpressionsPHP Regular Expressions
PHP Regular Expressions
 
[OOP - Lec 08] Encapsulation (Information Hiding)
[OOP - Lec 08] Encapsulation (Information Hiding)[OOP - Lec 08] Encapsulation (Information Hiding)
[OOP - Lec 08] Encapsulation (Information Hiding)
 
스프링 시큐리티 구조 이해
스프링 시큐리티 구조 이해스프링 시큐리티 구조 이해
스프링 시큐리티 구조 이해
 

Similar to Opps Concept

Nhibernate Part 2
Nhibernate   Part 2Nhibernate   Part 2
Nhibernate Part 2guest075fec
 
Object Oriented PHP by Dr.C.R.Dhivyaa Kongu Engineering College
Object Oriented PHP by Dr.C.R.Dhivyaa Kongu Engineering CollegeObject Oriented PHP by Dr.C.R.Dhivyaa Kongu Engineering College
Object Oriented PHP by Dr.C.R.Dhivyaa Kongu Engineering CollegeDhivyaa C.R
 
Wordpress (class,property,visibility,const,destr,inheritence,mysql etc)
Wordpress (class,property,visibility,const,destr,inheritence,mysql etc)Wordpress (class,property,visibility,const,destr,inheritence,mysql etc)
Wordpress (class,property,visibility,const,destr,inheritence,mysql etc)Rathod Shukar
 
Take the Plunge with OOP from #pnwphp
Take the Plunge with OOP from #pnwphpTake the Plunge with OOP from #pnwphp
Take the Plunge with OOP from #pnwphpAlena Holligan
 
Lecture-10_PHP-OOP.pptx
Lecture-10_PHP-OOP.pptxLecture-10_PHP-OOP.pptx
Lecture-10_PHP-OOP.pptxShaownRoy1
 
Demystifying Object-Oriented Programming #ssphp16
Demystifying Object-Oriented Programming #ssphp16Demystifying Object-Oriented Programming #ssphp16
Demystifying Object-Oriented Programming #ssphp16Alena Holligan
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented ProgrammingIqra khalil
 
Lecture 24 multiple-fileprograming.pptx
Lecture 24 multiple-fileprograming.pptxLecture 24 multiple-fileprograming.pptx
Lecture 24 multiple-fileprograming.pptxAyeCS11
 
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco GralikeBoost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco GralikeMarco Gralike
 
OOPs Concepts - Android Programming
OOPs Concepts - Android ProgrammingOOPs Concepts - Android Programming
OOPs Concepts - Android ProgrammingPurvik Rana
 
Querying XML: XPath and XQuery
Querying XML: XPath and XQueryQuerying XML: XPath and XQuery
Querying XML: XPath and XQueryKatrien Verbert
 
Using Document Databases with TYPO3 Flow
Using Document Databases with TYPO3 FlowUsing Document Databases with TYPO3 Flow
Using Document Databases with TYPO3 FlowKarsten Dambekalns
 
Introducing PHP Latest Updates
Introducing PHP Latest UpdatesIntroducing PHP Latest Updates
Introducing PHP Latest UpdatesIftekhar Eather
 

Similar to Opps Concept (20)

Jscript part2
Jscript part2Jscript part2
Jscript part2
 
Nhibernate Part 2
Nhibernate   Part 2Nhibernate   Part 2
Nhibernate Part 2
 
Object Oriented PHP by Dr.C.R.Dhivyaa Kongu Engineering College
Object Oriented PHP by Dr.C.R.Dhivyaa Kongu Engineering CollegeObject Oriented PHP by Dr.C.R.Dhivyaa Kongu Engineering College
Object Oriented PHP by Dr.C.R.Dhivyaa Kongu Engineering College
 
UNIT III (8).pptx
UNIT III (8).pptxUNIT III (8).pptx
UNIT III (8).pptx
 
UNIT III (8).pptx
UNIT III (8).pptxUNIT III (8).pptx
UNIT III (8).pptx
 
Wordpress (class,property,visibility,const,destr,inheritence,mysql etc)
Wordpress (class,property,visibility,const,destr,inheritence,mysql etc)Wordpress (class,property,visibility,const,destr,inheritence,mysql etc)
Wordpress (class,property,visibility,const,destr,inheritence,mysql etc)
 
Take the Plunge with OOP from #pnwphp
Take the Plunge with OOP from #pnwphpTake the Plunge with OOP from #pnwphp
Take the Plunge with OOP from #pnwphp
 
Lecture-10_PHP-OOP.pptx
Lecture-10_PHP-OOP.pptxLecture-10_PHP-OOP.pptx
Lecture-10_PHP-OOP.pptx
 
OOP in PHP
OOP in PHPOOP in PHP
OOP in PHP
 
Demystifying Object-Oriented Programming #ssphp16
Demystifying Object-Oriented Programming #ssphp16Demystifying Object-Oriented Programming #ssphp16
Demystifying Object-Oriented Programming #ssphp16
 
java part 1 computer science.pptx
java part 1 computer science.pptxjava part 1 computer science.pptx
java part 1 computer science.pptx
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
 
Lecture 24 multiple-fileprograming.pptx
Lecture 24 multiple-fileprograming.pptxLecture 24 multiple-fileprograming.pptx
Lecture 24 multiple-fileprograming.pptx
 
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco GralikeBoost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
 
OOPs Concepts - Android Programming
OOPs Concepts - Android ProgrammingOOPs Concepts - Android Programming
OOPs Concepts - Android Programming
 
Encapsulation C++
Encapsulation C++Encapsulation C++
Encapsulation C++
 
Querying XML: XPath and XQuery
Querying XML: XPath and XQueryQuerying XML: XPath and XQuery
Querying XML: XPath and XQuery
 
Using Document Databases with TYPO3 Flow
Using Document Databases with TYPO3 FlowUsing Document Databases with TYPO3 Flow
Using Document Databases with TYPO3 Flow
 
Inheritance
Inheritance Inheritance
Inheritance
 
Introducing PHP Latest Updates
Introducing PHP Latest UpdatesIntroducing PHP Latest Updates
Introducing PHP Latest Updates
 

Recently uploaded

Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...arifengg7
 
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptxTriangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptxRomil Mishra
 
KCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitosKCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitosVictor Morales
 
10 AsymmetricKey Cryptography students.pptx
10 AsymmetricKey Cryptography students.pptx10 AsymmetricKey Cryptography students.pptx
10 AsymmetricKey Cryptography students.pptxAdityaGoogle
 
Javier_Fernandez_CARS_workshop_presentation.pptx
Javier_Fernandez_CARS_workshop_presentation.pptxJavier_Fernandez_CARS_workshop_presentation.pptx
Javier_Fernandez_CARS_workshop_presentation.pptxJavier Fernández Muñoz
 
Machine Learning 5G Federated Learning.pdf
Machine Learning 5G Federated Learning.pdfMachine Learning 5G Federated Learning.pdf
Machine Learning 5G Federated Learning.pdfadeyimikaipaye
 
A brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision ProA brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision ProRay Yuan Liu
 
Artificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewArtificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewsandhya757531
 
Indian Tradition, Culture & Societies.pdf
Indian Tradition, Culture & Societies.pdfIndian Tradition, Culture & Societies.pdf
Indian Tradition, Culture & Societies.pdfalokitpathak01
 
Introduction to Machine Learning Part1.pptx
Introduction to Machine Learning Part1.pptxIntroduction to Machine Learning Part1.pptx
Introduction to Machine Learning Part1.pptxPavan Mohan Neelamraju
 
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTFUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTSneha Padhiar
 
70 POWER PLANT IAE V2500 technical training
70 POWER PLANT IAE V2500 technical training70 POWER PLANT IAE V2500 technical training
70 POWER PLANT IAE V2500 technical trainingGladiatorsKasper
 
Cost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionCost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionSneha Padhiar
 
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...KrishnaveniKrishnara1
 
priority interrupt computer organization
priority interrupt computer organizationpriority interrupt computer organization
priority interrupt computer organizationchnrketan
 
Defining the Clouds for entriprises.pptx
Defining the Clouds for entriprises.pptxDefining the Clouds for entriprises.pptx
Defining the Clouds for entriprises.pptxAshwiniTodkar4
 
ADM100 Running Book for sap basis domain study
ADM100 Running Book for sap basis domain studyADM100 Running Book for sap basis domain study
ADM100 Running Book for sap basis domain studydhruvamdhruvil123
 
Chapter 9 Mechanical Injection Systems.pdf
Chapter 9 Mechanical Injection Systems.pdfChapter 9 Mechanical Injection Systems.pdf
Chapter 9 Mechanical Injection Systems.pdfFaizanAhmed396943
 
AntColonyOptimizationManetNetworkAODV.pptx
AntColonyOptimizationManetNetworkAODV.pptxAntColonyOptimizationManetNetworkAODV.pptx
AntColonyOptimizationManetNetworkAODV.pptxLina Kadam
 
Design and Analysis of Algorithms Lecture Notes
Design and Analysis of Algorithms Lecture NotesDesign and Analysis of Algorithms Lecture Notes
Design and Analysis of Algorithms Lecture NotesSreedhar Chowdam
 

Recently uploaded (20)

Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
 
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptxTriangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptx
 
KCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitosKCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitos
 
10 AsymmetricKey Cryptography students.pptx
10 AsymmetricKey Cryptography students.pptx10 AsymmetricKey Cryptography students.pptx
10 AsymmetricKey Cryptography students.pptx
 
Javier_Fernandez_CARS_workshop_presentation.pptx
Javier_Fernandez_CARS_workshop_presentation.pptxJavier_Fernandez_CARS_workshop_presentation.pptx
Javier_Fernandez_CARS_workshop_presentation.pptx
 
Machine Learning 5G Federated Learning.pdf
Machine Learning 5G Federated Learning.pdfMachine Learning 5G Federated Learning.pdf
Machine Learning 5G Federated Learning.pdf
 
A brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision ProA brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision Pro
 
Artificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewArtificial Intelligence in Power System overview
Artificial Intelligence in Power System overview
 
Indian Tradition, Culture & Societies.pdf
Indian Tradition, Culture & Societies.pdfIndian Tradition, Culture & Societies.pdf
Indian Tradition, Culture & Societies.pdf
 
Introduction to Machine Learning Part1.pptx
Introduction to Machine Learning Part1.pptxIntroduction to Machine Learning Part1.pptx
Introduction to Machine Learning Part1.pptx
 
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTFUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
 
70 POWER PLANT IAE V2500 technical training
70 POWER PLANT IAE V2500 technical training70 POWER PLANT IAE V2500 technical training
70 POWER PLANT IAE V2500 technical training
 
Cost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionCost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based question
 
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
 
priority interrupt computer organization
priority interrupt computer organizationpriority interrupt computer organization
priority interrupt computer organization
 
Defining the Clouds for entriprises.pptx
Defining the Clouds for entriprises.pptxDefining the Clouds for entriprises.pptx
Defining the Clouds for entriprises.pptx
 
ADM100 Running Book for sap basis domain study
ADM100 Running Book for sap basis domain studyADM100 Running Book for sap basis domain study
ADM100 Running Book for sap basis domain study
 
Chapter 9 Mechanical Injection Systems.pdf
Chapter 9 Mechanical Injection Systems.pdfChapter 9 Mechanical Injection Systems.pdf
Chapter 9 Mechanical Injection Systems.pdf
 
AntColonyOptimizationManetNetworkAODV.pptx
AntColonyOptimizationManetNetworkAODV.pptxAntColonyOptimizationManetNetworkAODV.pptx
AntColonyOptimizationManetNetworkAODV.pptx
 
Design and Analysis of Algorithms Lecture Notes
Design and Analysis of Algorithms Lecture NotesDesign and Analysis of Algorithms Lecture Notes
Design and Analysis of Algorithms Lecture Notes
 

Opps Concept

  • 1. OOP (Object Oriented Programming) https://htree.plus/ Presented By, Nisarg Raval Kadam Parikh Kishan Sakariya Ria Jain
  • 2. What is OOP & 4-pillar? ❏ Object-oriented programming (OOP) is a programming language model in which programs are organized around data, or objects, rather than functions and logic. https://htree.plus/ Encapsulation Inheritance Polymorphism AbstractionOOP (4-pillar)
  • 3. https://htree.plus/ Inheritance ❏ Concepts at higher levels are more general. ❏ Concepts at lower levels are more specific (inherit properties of concepts at higher levels) Vehicle Wheeled Vehicle Boat Car Bicycle
  • 4. Inheritance (By Programming) https://htree.plus/ ❏ The language mechanism by which one class acquires the properties (data and operations) of another class ❏ Base Class (or superclass): the class being inherited from ❏ Derived Class (or subclass): the class that inherits
  • 5. https://htree.plus/ ❏ You can reuse the methods and data of the existing class ❏ You can extend the existing class by adding new data and new methods ❏ You can modify the existing class by overloading its methods with your own implementations Advantages Of Inheritance
  • 6. https://htree.plus/ Abstraction ❏ Objects in an OOP language provide an abstraction that hides the internal implementation details. ❏ Abstraction refers to the concept of hiding the complexities of a system from the users of that system
  • 7. Abstraction (Real World Example) ● For example, the coffee machine in your kitchen, you just need to know which methods of the object are available to call and which input parameters are needed to trigger a specific operation. But you don’t need to understand how this method is implemented and which kinds of actions it has to perform to create the expected result.
  • 8. Abstraction (By Programming) using namespace std; class implementAbstraction { private: int a, b; public: // method to set values of // private members void set(int x, int y) { a = x; b = y; } void display() { cout<<"a = " <<a << endl; cout<<"b = " << b << endl; } }; int main() { implementAbstraction obj; obj.set(10, 20); obj.display(); return 0; }
  • 9. https://htree.plus/ Encapsulation ❏ Encapsulation is a process of combining data members and functions in a single unit called class.
  • 10. https://htree.plus/ Encapsulation (Example) ❏ using System; ❏ namespace OPPs { ❏ class Encapsulation { ❏ private string Name = "Alex"; ❏ public string EmployeeName { // Property ❏ get { ❏ return Name; ❏ } ❏ set { ❏ Name = value; ❏ } ❏ } ❏ static void Main(string[] args) { ❏ string Name2 = string.Empty; ❏ // use properties ❏ Encapsulation e = new Encapsulation(); ❏ Name2 = e.EmployeeName; ❏ Console.WriteLine("Employee Name: " + Name2); ❏ Console.ReadLine(); ❏ } ❏ } ❏ }
  • 11. https://htree.plus/ Advantages Of Encapsulation & Abstraction ❏ Encapsulation helps us in binding the data(instance variables) and the member functions(that work on the instance variables) of a class. ❏ Abstraction helps the user to avoid writing the low level code ❏ Abstraction avoids code duplication and increases reusability. ❏ Abstraction can change internal implementation of class independently without affecting the user.
  • 12. https://htree.plus/ Polymorphism (By Real World Example) ● The word ‘polymorphism’ literally means ‘a state of having many shapes’ or ‘the capacity to take on different forms’.
  • 13. https://htree.plus/ Polymorphism (By Programming) ❏ Two types of polymorphism : - Dynamic Polymorphism - Static Polymorphism ❏ The process of binding the overloaded method within object at compile time is known as Static polymorphism ❏ In dynamic polymorphism method of the program binds with an object at runtime
  • 15. https://htree.plus/ Advantages Of Polymorphism ❏ It helps programmers reuse the code and classes once written, tested and implemented. They can be reused in many ways. ❏ Single variable name can be used to store variables of multiple data types(Float, double, Long, Int etc). ❏ Polymorphism helps in reducing the coupling between different functionalities.
  • 16. References ❏ https://medium.com/omarelgabrys-blog/the-story-of-object-oriented-programming- 12d1901a1825 ❏ https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html ❏ http://cs.smu.ca/~porter/csc/465/notes/oop.html ❏ https://atomicobject.com/resources/oo-programming/oo-quality ❏ https://medium.com/from-the-scratch/oop-everything-you-need-to-know-about-object- oriented-programming-aee3c18e281b ❏ https://www.javatpoint.com/java-oops-concepts ❏ https://tomassetti.me/oops-concepts/ ❏ http://www.differencebetween.net/technology/difference-between-oop-and-pop/ ❏ https://en.wikipedia.org/wiki/Object-oriented_programming ❏ https://en.wikipedia.org/wiki/Access_modifiers https://htree.plus/