SlideShare a Scribd company logo
1 of 14
Download to read offline
INTRODUCTION TO OBJECT-
ORIENTED PROGRAMMING
(OOP)
1
OOP CONCEPT
 Enable programmers to create modules that do not
need to be changed when a new type of object is
added.
 Programmer can simply create a new object that
inherits many of its features from existing objects
 Makes object-oriented programs easier to modify
2
HISTORY OF OOP
 Many people believe that OOP is a product of the
1980s (Bjarne Stroustrup).
 Actually, SIMULA 1 (1962) and Simula 67 (1967)
[earliest object-oriented languages]
 The work on the Simula languages (Ole-John Dahl
and Kristen Nygaard) at the Norwegian Computing
Center in Oslo, Norway.
 Most of the advantages of OOP available in the
earlier Simula languages, it wasn't until C++
became entrenched in the 1990s that OOP began
to flourish.
3
ADVANTAGES OF USING OOP
 OOP provides a clear modular structure for
programs which makes it good for
defining abstract data types where implementation
details are hidden and the unit has a clearly defined
interface.
 OOP makes it easy to maintain and modify existing
code as new objects can be created with small
differences to existing ones.
 OOP provides a good framework for code libraries
where supplied software components can be easily
adapted and modified by the programmer.
4
TERMINOLOGIES OF OOP
 Classes
 Object
 Encapsulation
 Data Abstraction
 Inheritance
 Polymorphism
5
CLASSES
 A collection of objects of a similar type.
 Once a class is defined, any number of objects can
be created which belong to that class.
 A class is a blueprint, or prototype, that defines the
variables and the methods common to all objects of
a certain kind.
6
OBJECT
 An instance of a class.
 A class must be instantiated into an object before it
can be used in the software.
 A software bundle of related state and behavior.
 More than one instance of the same class can be in
existence at any one time.
7
ENCAPSULATION
 Storing data and functions in a single unit
(class).
 Mechanism that binds together code and
data in manipulates.
 Keeps both safe from outside interference
and misuse.
 Data cannot be accessible to the outside
world and only those functions which are
stored in the class can access it.
8
DATA ABSTRACTION
 Abstraction refers to the act of representing
essential features without including the background
details or explanations.
 Classes use the concept of abstraction and are
defined as a list of abstract attributes.
9
INHERITANCE
 Provides a powerful and natural mechanism for
organizing and structuring your software.
 This section explains how classes inherit state and
behavior from their superclasses, and explains how
to derive one class from another using the simple
syntax provided by the Java programming
language.
10
POLYMORPHISM
 The ability to take more than one form.
 An operation may exhibit different behaviors in
different instances.
 The behavior depends on the data types used in
the operation.
 In general, polymorphism means “one interface,
multiple method”
 Reduce complexity by allowing the same
interface to be used to specify a general class of
action.
11
DISTINGUISH BETWEEN ABSTRACTION AND
ENCAPSULATION
ABSTRACTION ENCAPSULATION
Refers to showing only the
necessary details to the intended
user
Means to hide (data hiding).
Wrapping, just hiding
properties and methods.
Used in programming languages
to make abstract class.
Used for hide the code and
data in a single unit to protect
the data from the outside the
world.
Abstraction is implemented using
interface and abstract class
Encapsulation is
implemented using private
and protected access
modifier. 12
EXAMPLES
ABSTRACTION
ENCAPSULATION
Class Encapsulation
{
private int marks;
public int Marks
{
get { return marks; }
set { marks = value;}
}
}
abstract class Abstraction
{
public abstract void
doAbstraction();
}
public class AbstractionImpl:
Abstraction
{
public void doAbstraction()
{
//Implement it
}
}
13
DIFFERENCES
Structured Programming OOP
Follow top-down approach to
program design.
Follow bottom-up approach in
program design.
Data and Functions don’t tide with
each other.
Functions and data are tide
together.
Large programs are divided into
smaller self contained program
segment known as functions.
Programs are divided into entity
called Objects.
Data moves openly around the
system from function to function.
Data is hidden and can’t be
accessed by the external world
Functions are dependent so
reusability is not possible
Functions are not dependent so
reusability is possible 14

More Related Content

Similar to babsatu-140703233001-phpapp666666601.pdf

Similar to babsatu-140703233001-phpapp666666601.pdf (20)

1 intro
1 intro1 intro
1 intro
 
Object oriented programming concept
Object oriented programming conceptObject oriented programming concept
Object oriented programming concept
 
OOP
OOPOOP
OOP
 
Oops concepts
Oops conceptsOops concepts
Oops concepts
 
A Survey of Object Oriented Programming LanguagesMaya Hris.docx
A Survey of Object Oriented Programming LanguagesMaya Hris.docxA Survey of Object Oriented Programming LanguagesMaya Hris.docx
A Survey of Object Oriented Programming LanguagesMaya Hris.docx
 
Features of Object Oriented Programming.pptx
Features of Object Oriented Programming.pptxFeatures of Object Oriented Programming.pptx
Features of Object Oriented Programming.pptx
 
M.c.a. (sem iv)- java programming
M.c.a. (sem   iv)- java programmingM.c.a. (sem   iv)- java programming
M.c.a. (sem iv)- java programming
 
Introduction of OOPs
Introduction of OOPsIntroduction of OOPs
Introduction of OOPs
 
JAVA PROGRAMMING
JAVA PROGRAMMING JAVA PROGRAMMING
JAVA PROGRAMMING
 
Birasa 1
Birasa 1Birasa 1
Birasa 1
 
Unit 1 OOSE
Unit 1 OOSE Unit 1 OOSE
Unit 1 OOSE
 
Fundamentals of oops in .Net
Fundamentals of oops in .NetFundamentals of oops in .Net
Fundamentals of oops in .Net
 
JAVA PROGRAMMINGD
JAVA PROGRAMMINGDJAVA PROGRAMMINGD
JAVA PROGRAMMINGD
 
Introduction to Java -unit-1
Introduction to Java -unit-1Introduction to Java -unit-1
Introduction to Java -unit-1
 
OOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdfOOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdf
 
Oo ps concepts in c++
Oo ps concepts in c++Oo ps concepts in c++
Oo ps concepts in c++
 
MCA NOTES.pdf
MCA NOTES.pdfMCA NOTES.pdf
MCA NOTES.pdf
 
Java pdf
Java   pdfJava   pdf
Java pdf
 
Basic concept of OOP's
Basic concept of OOP'sBasic concept of OOP's
Basic concept of OOP's
 
Object oriented vs. object based programming
Object oriented vs. object based  programmingObject oriented vs. object based  programming
Object oriented vs. object based programming
 

More from kashafishfaq21

Registers.pptxmjgfdgjbgghjghjjfyujgftujbvf
Registers.pptxmjgfdgjbgghjghjjfyujgftujbvfRegisters.pptxmjgfdgjbgghjghjjfyujgftujbvf
Registers.pptxmjgfdgjbgghjghjjfyujgftujbvfkashafishfaq21
 
encapsulation1-150816163959-lva1-app6891.pdf
encapsulation1-150816163959-lva1-app6891.pdfencapsulation1-150816163959-lva1-app6891.pdf
encapsulation1-150816163959-lva1-app6891.pdfkashafishfaq21
 
HAFIZA PP666666576887654678876544566T.pdf
HAFIZA  PP666666576887654678876544566T.pdfHAFIZA  PP666666576887654678876544566T.pdf
HAFIZA PP666666576887654678876544566T.pdfkashafishfaq21
 
circuits-150320014416-conversion-gate01.pdf
circuits-150320014416-conversion-gate01.pdfcircuits-150320014416-conversion-gate01.pdf
circuits-150320014416-conversion-gate01.pdfkashafishfaq21
 
inheritance-16031525566nbhij56604452.pdf
inheritance-16031525566nbhij56604452.pdfinheritance-16031525566nbhij56604452.pdf
inheritance-16031525566nbhij56604452.pdfkashafishfaq21
 
polymorphism-17013114666666666653806.pdf
polymorphism-17013114666666666653806.pdfpolymorphism-17013114666666666653806.pdf
polymorphism-17013114666666666653806.pdfkashafishfaq21
 
logicgates-180511113246666666660 (1).pdf
logicgates-180511113246666666660 (1).pdflogicgates-180511113246666666660 (1).pdf
logicgates-180511113246666666660 (1).pdfkashafishfaq21
 
ifrad01605545networkcomponents-181123160910.pdf
ifrad01605545networkcomponents-181123160910.pdfifrad01605545networkcomponents-181123160910.pdf
ifrad01605545networkcomponents-181123160910.pdfkashafishfaq21
 

More from kashafishfaq21 (8)

Registers.pptxmjgfdgjbgghjghjjfyujgftujbvf
Registers.pptxmjgfdgjbgghjghjjfyujgftujbvfRegisters.pptxmjgfdgjbgghjghjjfyujgftujbvf
Registers.pptxmjgfdgjbgghjghjjfyujgftujbvf
 
encapsulation1-150816163959-lva1-app6891.pdf
encapsulation1-150816163959-lva1-app6891.pdfencapsulation1-150816163959-lva1-app6891.pdf
encapsulation1-150816163959-lva1-app6891.pdf
 
HAFIZA PP666666576887654678876544566T.pdf
HAFIZA  PP666666576887654678876544566T.pdfHAFIZA  PP666666576887654678876544566T.pdf
HAFIZA PP666666576887654678876544566T.pdf
 
circuits-150320014416-conversion-gate01.pdf
circuits-150320014416-conversion-gate01.pdfcircuits-150320014416-conversion-gate01.pdf
circuits-150320014416-conversion-gate01.pdf
 
inheritance-16031525566nbhij56604452.pdf
inheritance-16031525566nbhij56604452.pdfinheritance-16031525566nbhij56604452.pdf
inheritance-16031525566nbhij56604452.pdf
 
polymorphism-17013114666666666653806.pdf
polymorphism-17013114666666666653806.pdfpolymorphism-17013114666666666653806.pdf
polymorphism-17013114666666666653806.pdf
 
logicgates-180511113246666666660 (1).pdf
logicgates-180511113246666666660 (1).pdflogicgates-180511113246666666660 (1).pdf
logicgates-180511113246666666660 (1).pdf
 
ifrad01605545networkcomponents-181123160910.pdf
ifrad01605545networkcomponents-181123160910.pdfifrad01605545networkcomponents-181123160910.pdf
ifrad01605545networkcomponents-181123160910.pdf
 

Recently uploaded

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
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
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 

Recently uploaded (20)

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .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...
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 

babsatu-140703233001-phpapp666666601.pdf

  • 1. INTRODUCTION TO OBJECT- ORIENTED PROGRAMMING (OOP) 1
  • 2. OOP CONCEPT  Enable programmers to create modules that do not need to be changed when a new type of object is added.  Programmer can simply create a new object that inherits many of its features from existing objects  Makes object-oriented programs easier to modify 2
  • 3. HISTORY OF OOP  Many people believe that OOP is a product of the 1980s (Bjarne Stroustrup).  Actually, SIMULA 1 (1962) and Simula 67 (1967) [earliest object-oriented languages]  The work on the Simula languages (Ole-John Dahl and Kristen Nygaard) at the Norwegian Computing Center in Oslo, Norway.  Most of the advantages of OOP available in the earlier Simula languages, it wasn't until C++ became entrenched in the 1990s that OOP began to flourish. 3
  • 4. ADVANTAGES OF USING OOP  OOP provides a clear modular structure for programs which makes it good for defining abstract data types where implementation details are hidden and the unit has a clearly defined interface.  OOP makes it easy to maintain and modify existing code as new objects can be created with small differences to existing ones.  OOP provides a good framework for code libraries where supplied software components can be easily adapted and modified by the programmer. 4
  • 5. TERMINOLOGIES OF OOP  Classes  Object  Encapsulation  Data Abstraction  Inheritance  Polymorphism 5
  • 6. CLASSES  A collection of objects of a similar type.  Once a class is defined, any number of objects can be created which belong to that class.  A class is a blueprint, or prototype, that defines the variables and the methods common to all objects of a certain kind. 6
  • 7. OBJECT  An instance of a class.  A class must be instantiated into an object before it can be used in the software.  A software bundle of related state and behavior.  More than one instance of the same class can be in existence at any one time. 7
  • 8. ENCAPSULATION  Storing data and functions in a single unit (class).  Mechanism that binds together code and data in manipulates.  Keeps both safe from outside interference and misuse.  Data cannot be accessible to the outside world and only those functions which are stored in the class can access it. 8
  • 9. DATA ABSTRACTION  Abstraction refers to the act of representing essential features without including the background details or explanations.  Classes use the concept of abstraction and are defined as a list of abstract attributes. 9
  • 10. INHERITANCE  Provides a powerful and natural mechanism for organizing and structuring your software.  This section explains how classes inherit state and behavior from their superclasses, and explains how to derive one class from another using the simple syntax provided by the Java programming language. 10
  • 11. POLYMORPHISM  The ability to take more than one form.  An operation may exhibit different behaviors in different instances.  The behavior depends on the data types used in the operation.  In general, polymorphism means “one interface, multiple method”  Reduce complexity by allowing the same interface to be used to specify a general class of action. 11
  • 12. DISTINGUISH BETWEEN ABSTRACTION AND ENCAPSULATION ABSTRACTION ENCAPSULATION Refers to showing only the necessary details to the intended user Means to hide (data hiding). Wrapping, just hiding properties and methods. Used in programming languages to make abstract class. Used for hide the code and data in a single unit to protect the data from the outside the world. Abstraction is implemented using interface and abstract class Encapsulation is implemented using private and protected access modifier. 12
  • 13. EXAMPLES ABSTRACTION ENCAPSULATION Class Encapsulation { private int marks; public int Marks { get { return marks; } set { marks = value;} } } abstract class Abstraction { public abstract void doAbstraction(); } public class AbstractionImpl: Abstraction { public void doAbstraction() { //Implement it } } 13
  • 14. DIFFERENCES Structured Programming OOP Follow top-down approach to program design. Follow bottom-up approach in program design. Data and Functions don’t tide with each other. Functions and data are tide together. Large programs are divided into smaller self contained program segment known as functions. Programs are divided into entity called Objects. Data moves openly around the system from function to function. Data is hidden and can’t be accessed by the external world Functions are dependent so reusability is not possible Functions are not dependent so reusability is possible 14